Allow using patterns to match multiple Secret or ConfigMap fields #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:*.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.ca.crt
should even when treated as patterns match only the field namedca.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.