Skip to content

[BUG] Ignore configmaps results in permission errors #1068

@hugoboos

Description

@hugoboos

Describe the bug
Using the Helm chart to deploy Reloader and setting reloader.ignoreConfigMaps: true results in error logs. See the context for the output.

To Reproduce
Deploy the Helm chart with version 2.2.7 and the following values:

ignoreConfigMaps: true
ignoreJobs: true
ignoreCronJobs: true
reloadStrategy: annotations
namespaceSelector: kustomize.toolkit.fluxcd.io/name in (organizations, tenants)
readOnlyRootFileSystem: true
deployment:
  labels: null
  containerSecurityContext:
    capabilities:
      drop:
        - ALL
    allowPrivilegeEscalation: false

Expected behavior
Not seeing errors in the logs.

Screenshots
N.A.

Environment

  • Helm chart version: 2.2.7
  • Kubernetes/OpenShift version: 1.34.0

Additional context

# Arguments
--log-level=info --resources-to-ignore=configMaps --ignored-workload-types=jobs,cronjobs --namespace-selector="kustomize.toolkit.fluxcd.io/name in (organizations, tenants)" --reload-strategy=annotations
time="2025-12-16T08:35:09Z" level=info msg="Environment: Kubernetes"
time="2025-12-16T08:35:09Z" level=info msg="Starting Reloader"
time="2025-12-16T08:35:09Z" level=warning msg="KUBERNETES_NAMESPACE is unset, will detect changes in all namespaces."
time="2025-12-16T08:35:09Z" level=warning msg="namespace-selector is set, will only detect changes in namespaces with these labels: kustomize.toolkit.fluxcd.io/name in (organizations, tenants)."
time="2025-12-16T08:35:09Z" level=info msg="created controller for: secrets"
time="2025-12-16T08:35:09Z" level=info msg="Starting Controller to watch resource type: secrets"
time="2025-12-16T08:35:09Z" level=info msg="created controller for: namespaces"
time="2025-12-16T08:35:09Z" level=info msg="Starting Controller to watch resource type: namespaces"
time="2025-12-16T08:35:09Z" level=info msg="created controller for: configmaps"
time="2025-12-16T08:35:09Z" level=info msg="Starting Controller to watch resource type: configmaps"
W1216 08:35:09.906018       1 reflector.go:569] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: failed to list *v1.ConfigMap: configmaps is forbidden: User "system:serviceaccount:fds-system:stakater-reloader" cannot list resource "configmaps" in API group "" at the cluster scope
E1216 08:35:09.906110       1 reflector.go:166] "Unhandled Error" err="pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: Failed to watch *v1.ConfigMap: failed to list *v1.ConfigMap: configmaps is forbidden: User \"system:serviceaccount:fds-system:stakater-reloader\" cannot list resource \"configmaps\" in API group \"\" at the cluster scope" logger="UnhandledError"

Found the bug

In reloader.go the resource is checked if it is ignored:

if ignoredResourcesList.Contains(k) || (len(namespaceLabelSelector) == 0 && k == "namespaces") {

The ResourceMap contains configmap with a lower case m so never ignoring that resource:
"configmaps": &v1.ConfigMap{},

So configMap (cli argument) <> configmap (ResourceMap).

Metadata

Metadata

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions