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

OpenShift environment variables with dashes or other special chars in name must be also present in lower priority dotted config source to be matched #923

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

michalvavrik
Copy link
Member

@michalvavrik michalvavrik commented Oct 19, 2023

Summary

#904 and #917 follow-up

Right now OpenShift tests that has dashes or other non-alphanumeric charcters in property key name (between dots) are not resolved if they are also not present in dotted config source as explain by Quarkus docs https://quarkus.io/version/main/guides/config-reference#environment-variables. This PR adds these properties as Quarkus Application config source and thus helps SR Config to resolve them.

Also bumps Kafka operator version so that we can test related tests and Kafka operator doesn't support 3.4.0 version anymore.

Please check the relevant options

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Dependency update
  • Refactoring
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • This change requires execution against OCP (use run tests phrase in comment)

Checklist:

  • Example scenarios has been updated / added
  • Methods and classes used in PR scenarios are meaningful
  • Commits are well encapsulated and follow the best practices

@michalvavrik
Copy link
Member Author

run tests

@michalvavrik
Copy link
Member Author

michalvavrik commented Oct 19, 2023

OpenShiftStrimziOperatorKafkaWithoutRegistryMessagingIT is failing before this PR and it can't have anything to do with this PR. because it fails during Kafka installation and this PR only touches Quarkus deployment configs.

I'm working on it, but it's a separate ongoing issue related to the Operator and this PR fixes what it says - for example OpenShiftStrimziKafkaWithRegistryMessagingIT

@michalvavrik
Copy link
Member Author

Ah, so the one failing test is failing because operator doesn't support our Kafka version Unsupported Kafka.spec.kafka.version: 3.4.0. Supported versions are: [3.5.0, 3.5.1, 3.6.0]

@michalvavrik michalvavrik force-pushed the feature/fix-oc-env-var-injection branch from 30cb43f to febe016 Compare October 19, 2023 19:05
@michalvavrik
Copy link
Member Author

run test

@michalvavrik
Copy link
Member Author

run tests

// transform entry key => value to key=value and make it one string like application.properties
var appProperties = propsWithDotsOrOtherSpecChar
.stream()
.map(propKey -> propKey + "=" + enrichProperties.get(propKey) + "\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems, that instead of storing filtered keys of property names and properties themselves in a separate structures, we can have a map of filtered properties. That will significantly easy cognitive load.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Copy link
Member Author

Choose a reason for hiding this comment

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

it's one string now

@michalvavrik michalvavrik force-pushed the feature/fix-oc-env-var-injection branch from febe016 to edd9ee2 Compare October 20, 2023 08:57
@michalvavrik michalvavrik force-pushed the feature/fix-oc-env-var-injection branch from edd9ee2 to 71fa5fd Compare October 20, 2023 09:06
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik mentioned this pull request Oct 20, 2023
10 tasks
Copy link
Member

@mjurc mjurc left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@mjurc mjurc merged commit 4fe65a9 into quarkus-qe:main Oct 20, 2023
9 checks passed
@michalvavrik michalvavrik deleted the feature/fix-oc-env-var-injection branch October 20, 2023 12:12
@michalvavrik michalvavrik mentioned this pull request Oct 20, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants