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

Strange merging of configuration properties in native mode when using snake-case-like config properties form #36671

Closed
michalvavrik opened this issue Oct 24, 2023 · 7 comments
Labels

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Oct 24, 2023

Describe the bug

I have REST client url defined like this inside src/main/resources/application.properties:

io.quarkus.ts.opentelemetry.reactive.PingPongService/mp-rest/url=${pongservice_url}:${pongservice_port}

and when I deploy application to OpenShift, I have mounted $PWD/config/application.properties with:

application-properties:
----
pongservice_url=http://pongservice-ts-ejyxaezkwz.apps.ocp4-13.dynamic.quarkus

and environment variable defined in pod as:

pongservice_url: http://pongservice-ts-ejyxaezkwz.apps.ocp4-13.whatever

and receive exception like Invalid REST Client URL used: 'http://pongservice-ts-yfyycuckno.apps.ocp4-13.whatever:tcp://172.30.209.30:8080/hello'

Expected behavior

While I understand pongservice_url is not exactly kebab-case, I have to wonder - where does tcp://172.30.209.30:8080 comes from? Isn't this behavior strange?

Actual behavior

  • In JVM mode everything works
  • In native I get exception
  • In native it works if I convert environment variable name to the PONGSERVICE_URL

How to Reproduce?

Steps to reproduce the behavior:

  1. log in to OCP
  2. git clone [email protected]:michalvavrik/quarkus-test-suite.git
  3. cd quarkus-test-suite/monitoring/opentelemetry-reactive
  4. git checkout reproducer/oc-otel-native-issue
  5. mvn clean verify -Dopenshift -Dnative -Dit.test=OpenShiftOpentelemetryReactiveIT

I bet you can simulate it in native mode just on bare-metal, but you will need to define env variables and config source to different value than is in native. Didn't try it though.

Output of uname -a or ver

Fedora 38

Output of java -version

Temurin 17

Quarkus version or git rev

999-SNAPSHOT (due to Kubernetes client bumps and changes in #35322 I can't test it with earlier versions without significant changes)

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

Apache Maven 3.9.3

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 24, 2023

/cc @geoand (kubernetes,openshift), @iocanel (kubernetes,openshift)

@michalvavrik
Copy link
Member Author

I don't think this is an OpenShift issue, I'd rather say it's for @radcortez .

@michalvavrik
Copy link
Member Author

michalvavrik commented Oct 24, 2023

Maybe I should keep area/native-image label, not sure, I'll let someone else to decide.

@radcortez
Copy link
Member

I was not able to reproduce the issue, but I do have some observations:

and receive exception like Invalid REST Client URL used: 'http://pongservice-ts-yfyycuckno.apps.ocp4-13.whatever:tcp://172.30.209.30:8080/hello'

Where are you setting (and which value) for ${pongservice_port}? The detailed application.properties and env vars only reference pongservice_url. It seems that ${pongservice_port} is getting the value tcp://172.30.209.30:8080/hello.

I bet you can simulate it in native mode just on bare-metal, but you will need to define env variables and config source to different value than is in native. Didn't try it though.

I did try this, but maybe I'm missing some requirements. Are you able to provide me with a bare metal reproducer?

@michalvavrik
Copy link
Member Author

michalvavrik commented Oct 30, 2023

I was not able to reproduce the issue

Reproducing it is not exactly the issue for me, as for your questions, I'm bit buried under other tasks, but I'll either provide bare-metal reproduce or all config source values this or next week.

Where are you setting (and which value) for ${pongservice_port}? The detailed application.properties and env vars only reference pongservice_url. It seems that ${pongservice_port} is getting the value tcp://172.30.209.30:8080/hello.

I can easily test this theory by printing out config prop value. I'll do it as well and let you know.

https://github.com/michalvavrik/quarkus-test-suite/blob/reproducer/oc-otel-native-issue/monitoring/opentelemetry/src/main/resources/application.properties

@radcortez
Copy link
Member

@michalvavrik is this still an issue?

@michalvavrik
Copy link
Member Author

@michalvavrik is this still an issue?

I re-implemented our app so that we always have present config keys in a dotted config source. I think it's so edge case that it doesn't make sense to spend time on this unless there is someone else experiencing it. Let me close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants