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

Kubernetes env vars do not allow empty values #27663

Closed
antssilva96 opened this issue Sep 1, 2022 · 2 comments · Fixed by #27681
Closed

Kubernetes env vars do not allow empty values #27663

antssilva96 opened this issue Sep 1, 2022 · 2 comments · Fixed by #27681
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@antssilva96
Copy link

Describe the bug

When using quarkus kubernetes I need to set up a environment variable with value null

but I get

The config property quarkus.kubernetes.env.vars.TESTVAR is defined as the empty String ("") which the following Converter considered to be null: io.smallrye.config.Converters$BuiltInConverter -> [Help 1]

I think the problem is that in https://github.com/quarkusio/quarkus/blob/main/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/EnvVarsConfig.java the vars map is String->String and should be String->Optional if we do want this behavior to be possible.

Expected behavior

Being able to define env variables with empty values.

Actual behavior

An error prevents this.

How to Reproduce?

  1. Add quarkus kubernetes dependency
  2. Add to your application.properties an entry with a kubernetes env var with empty value like quarkus.kubernetes.env.vars.TESTVAR=

Output of uname -a or ver

No response

Output of java -version

openjdk version "17.0.2" 2022-01-18

GraalVM version (if different from Java)

No response

Quarkus version or git rev

<quarkus.platform.version>2.11.3.Final</quarkus.platform.version>

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.5

Additional information

No response

@antssilva96 antssilva96 added the kind/bug Something isn't working label Sep 1, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 1, 2022

/cc @Sgitario, @geoand, @iocanel

@Sgitario
Copy link
Contributor

Sgitario commented Sep 2, 2022

It makes sense to me to allow empty values. I've already provided a fix for this: #27681

@quarkus-bot quarkus-bot bot added this to the 2.13 - main milestone Sep 2, 2022
@gsmet gsmet modified the milestones: 2.13 - main, 2.12.1.Final Sep 5, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants