Use strings.ToLower so any casing (configMaps, ConfigMaps, sEcrets)
normalizes to the canonical lowercase ResourceMap key, and simplify the
flag help text. Addresses PR review feedback.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #1061 renamed the configmap key in kube.ResourceMap from "configMaps"
(camelCase) to "configmaps" (lowercase) to fix controllers not being
able to mark themselves as initialized. However, two callers were not
updated to match the new canonical key:
1. The Helm chart's deployment template still emits
`--resources-to-ignore=configMaps` (camelCase) when
`reloader.ignoreConfigMaps: true` is set.
2. The validation in `GetIgnoredResourcesList` only accepts the legacy
camelCase spelling.
Because `ignoredResourcesList.Contains(k)` uses case-sensitive string
equality, the lookup against the new lowercase ResourceMap key never
matches. The configmaps controller is created and starts watching
ConfigMaps cluster-wide, even though the chart's ClusterRole template
(also gated on `ignoreConfigMaps`) does not grant permission for it.
The resulting pod logs are full of:
configmaps is forbidden: User "system:serviceaccount:reloader:reloader-reloader"
cannot list resource "configmaps" in API group "" at the cluster scope
This change:
- Updates the chart deployment template to emit the canonical lowercase
`configmaps` value.
- Normalizes the input in `GetIgnoredResourcesList`, accepting both
`configMaps` (legacy, for backward compatibility with users who pass
the flag directly) and `configmaps` (canonical), and emitting the
canonical form to the caller.
- Updates the flag help text and adds tests covering both spellings.
* separate methods
* basic refactoring
* moved common code to util package to use it in gateway
* common check for argo rollouts
* made code compilable with latest changes on master
* Moved options to separate package and created CommandLineOptions instance that will be in sync with options values.
* reverted extra changes
* initialize CommandLineOptions with default options in module init
* wait for paused at annotation before checking deployment paused
* moved things around to fix things
* reverted unnecessary changes
* reverted rolling_upgrade changes
* reverted extra change
* additional checks in reloader
* refactor: ShouldReloadInternal method. It will be called by Reloader
ShouldReload has some additional resource/namespace filter checks which are not needed for Reloader
* added test cases
* moved config to sharable packae
* moved resource selector and label selctor methods
* fixed pipeline
* removed map.yaml
* removed vague comment
* separate methods
* basic refactoring
* moved common code to util package to use it in gateway
* common check for argo rollouts
* made code compilable with latest changes on master
* Moved options to separate package and created CommandLineOptions instance that will be in sync with options values.
* reverted extra changes
* initialize CommandLineOptions with default options in module init
* wait for paused at annotation before checking deployment paused
* moved things around to fix things
* reverted unnecessary changes
* reverted rolling_upgrade changes
* reverted extra change