Skip to content

Commit

Permalink
Merge pull request quarkusio#15202 from geoand/quarkusio#15201
Browse files Browse the repository at this point in the history
Properly handle '/' in kubernetes env var declaration
  • Loading branch information
geoand authored Feb 19, 2021
2 parents 76aeea7 + b4ac44e commit 6b5ad04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public static List<Env> convert(EnvVarsConfig e) {
}

public static String convertName(String name) {
return name != null ? name.toUpperCase().replace('-', '_').replace('.', '_') : null;
return name != null ? name.toUpperCase().replace('-', '_').replace('.', '_').replace('/', '_') : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public void assertGeneratedResources() throws IOException {
assertThat(container.getEnv())
.filteredOn(env -> "QUARKUS_KUBERNETES_CONFIG_ENABLED".equals(env.getName()))
.singleElement().satisfies(env -> assertThat(env.getValue()).isEqualTo("true"));
assertThat(container.getEnv())
.filteredOn(env -> "FOO_MP_REST_URL".equals(env.getName()))
.singleElement().satisfies(env -> assertThat(env.getValue()).isEqualTo("foo.url"));
final List<EnvFromSource> envFrom = container.getEnvFrom();
assertThat(envFrom).hasSize(2);
assertThat(envFrom)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ quarkus.kubernetes.env.vars.envvar=value
quarkus.kubernetes.env.vars."quarkus.kubernetes-config.enabled"=true
quarkus.kubernetes.env.configmaps=configName
quarkus.kubernetes.env.secrets=secretName
quarkus.kubernetes.env.mapping.foo/mp-rest/url.with-key=foo.url

0 comments on commit 6b5ad04

Please sign in to comment.