Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace '.' with '_' when generating env var in Kubernetes extension #14292

Merged
merged 2 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("-", "_") : null;
return name != null ? name.toUpperCase().replace('-', '_').replace('.', '_') : null;
}
}
4 changes: 2 additions & 2 deletions integration-tests/kubernetes/quarkus-standard-way/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down Expand Up @@ -115,7 +115,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-deployment</artifactId>
<artifactId>quarkus-resteasy-reactive-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public void assertGeneratedResources() throws IOException {
assertThat(container.getEnv())
.filteredOn(env -> "ENVVAR".equals(env.getName()))
.singleElement().satisfies(env -> assertThat(env.getValue()).isEqualTo("value"));
assertThat(container.getEnv())
.filteredOn(env -> "QUARKUS_KUBERNETES_CONFIG_ENABLED".equals(env.getName()))
.singleElement().satisfies(env -> assertThat(env.getValue()).isEqualTo("true"));
final List<EnvFromSource> envFrom = container.getEnvFrom();
assertThat(envFrom).hasSize(2);
assertThat(envFrom)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
quarkus.kubernetes.env.fields.fromfield=metadata.name
quarkus.kubernetes.env.vars.envvar=value
quarkus.kubernetes.env.vars."quarkus.kubernetes-config.enabled"=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! We must document this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is, where? :)

quarkus.kubernetes.env.configmaps=configName
quarkus.kubernetes.env.secrets=secretName