shell-operator icon indicating copy to clipboard operation
shell-operator copied to clipboard

namespace.labelSelector doesn't not trigger hook on namespace label change

Open redbaron opened this issue 11 months ago • 0 comments

It looks like when namespace.labelSelector is used then label updates to namespace don't trigger hook.

Expected behavior (what you expected to happen):

change to a namespace label listed in namespace.labelSelector should trigger hook execution.

Actual behavior (what actually happened):

hook is not executed when namespace label is changed.

Steps to reproduce:

With following hook config:

- name: configMaps
  apiVersion: v1
  kind: ConfigMap
  namespace:
    labelSelector:
      matchLabels:
        profile: "true"
  nameSelector:
    matchNames: ["app-config"]
  keepFullObjectsInMemory: false
  jqFilter: |
    {
      namespace: .metadata.namespace,
      config: .data."config.yml"
    }

update to labels on the namespace changes number of objects passed in .snapshot.configmaps and therefore I'd expect hook to execute with new value of BINDING_CONTEXT. It seems that because monitored ConfigMap objects themselves are not changed, hook run is skipped.

Environment:

  • Shell-operator version: 1.5.3
  • Kubernetes version: 1.30
  • Installation type (kubectl apply, helm chart, etc.):

Anything else we should know?:

Additional information for debugging (if necessary):

redbaron avatar Jan 30 '25 13:01 redbaron