Skip to content

fix: Normalize resources-to-ignore values to match ResourceMap keys#1088

Open
rafaelperoco wants to merge 1 commit into
stakater:masterfrom
rafaelperoco:fix/ignore-configmaps-case-mismatch
Open

fix: Normalize resources-to-ignore values to match ResourceMap keys#1088
rafaelperoco wants to merge 1 commit into
stakater:masterfrom
rafaelperoco:fix/ignore-configmaps-case-mismatch

Conversation

@rafaelperoco

Copy link
Copy Markdown

Summary

  • Fixes case mismatch between --resources-to-ignore=configMaps (camelCase) and ResourceMap keys (configmaps lowercase)
  • Adds unit tests for GetIgnoredResourcesList function

Problem

When using ignoreConfigMaps: true in Helm values, the generated --resources-to-ignore=configMaps flag was not working because ResourceMap uses lowercase keys. This caused permission errors when RBAC was configured without configmaps access.

Solution

Normalize the ignored resources list to lowercase in GetIgnoredResourcesList() to match ResourceMap keys.

Fixes #1068

@rafaelperoco rafaelperoco force-pushed the fix/ignore-configmaps-case-mismatch branch from 797a721 to edfc3a1 Compare January 21, 2026 19:07
@rafaelperoco rafaelperoco force-pushed the fix/ignore-configmaps-case-mismatch branch from edfc3a1 to 2f9bf33 Compare January 21, 2026 19:09
@rasheedamir

Copy link
Copy Markdown
Member

@TheiLLeniumStudios can you please review it?

@diogotorres97

Copy link
Copy Markdown

review please

@fjvela

fjvela commented May 7, 2026

Copy link
Copy Markdown

@TheiLLeniumStudios could you please review it?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a mismatch between the --resources-to-ignore flag values (e.g., configMaps) and kube.ResourceMap keys (lowercase like configmaps), which previously prevented configmaps from being ignored and could lead to RBAC permission errors (issue #1068).

Changes:

  • Normalize GetIgnoredResourcesList() output to lowercase so it matches kube.ResourceMap keys.
  • Add unit tests covering GetIgnoredResourcesList() behavior and error cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/pkg/util/util.go Normalizes ignored resource names to lowercase for consistent matching against ResourceMap keys.
internal/pkg/util/util_test.go Adds unit tests for ignored-resources parsing/validation and normalization behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/pkg/util/util.go
Comment on lines +126 to +129
normalizedList := make(List, len(ignoredResourcesList))
for i, v := range ignoredResourcesList {
normalizedList[i] = strings.ToLower(v)
}
Comment on lines +151 to +162
{
name: "configMaps normalized to lowercase",
resources: []string{"configMaps"},
expectError: false,
expected: []string{"configmaps"},
},
{
name: "secrets stays lowercase",
resources: []string{"secrets"},
expectError: false,
expected: []string{"secrets"},
},
@Ankita-Eric

Copy link
Copy Markdown

Hi,

We use reloader in our setup. And facing this bug. I wanted to know by when this fix would be available and in which release so that we can also plan our upgrades accordingly.

Thanks

@msafwankarim

Copy link
Copy Markdown
Contributor

Hi @Ankita-Eric!

This feature has been merged via #1145 and released in v1.4.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Ignore configmaps results in permission errors

7 participants