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

Allow using patterns to match multiple Secret or ConfigMap fields #27

Merged

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Jun 28, 2024

This PR ads support for loading multiple fields from a single Secret or ConfigMap based on a glob pattern. This is specifically intended for use with certificates, where it can be used to load all certificates based on a pattern such as *.crt (it uses Glob patterns already used in the Strimzi Cluster operator).

All matching fields in the given Secret or Config Map will be merged together and used as a single configuration value. By default, they will be separated by a new line. But users con configure other separators when needed using a configuration option.

Originally, I considered adding new providers (separate classes) for the pattern matching. But it should not be needed as this change should be backward compatible. All keys in the config provider will be treated as patterns. But because the keys in the ConfigMap or Secret must consist of alphanumeric characters, '-', '_' or '.', treating them as patterns should not cause any backward compatibility issues:

  • Keys such as *.crt are invalid and cannot be used as keys in ConfigMap or Secret. So it makes no sense to use them as the key in the previous versions of the config provider. So there should be no users using them right now.
  • Keys with the record name such as ca.crt should even when treated as patterns match only the field named ca.crt. This is the same as before.

The changes to the README file whitespace characters fix some wierd characters that we present in the file before this PR.

@scholzj scholzj added this to the 1.2.0 milestone Jun 28, 2024
@scholzj scholzj requested a review from ppatierno June 28, 2024 16:33
@scholzj scholzj force-pushed the allow-using-ptterns-to-match-multiple-fields branch from 4ddd979 to 208ee01 Compare June 28, 2024 18:12
Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM. Left some nits.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Signed-off-by: Jakub Scholz <[email protected]>
@scholzj scholzj merged commit 417c73a into strimzi:main Jun 30, 2024
7 checks passed
@scholzj scholzj deleted the allow-using-ptterns-to-match-multiple-fields branch June 30, 2024 21:33
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.

2 participants