redhat-cop / resource-locker-operator

Apache License 2.0
30 stars 14 forks source link

Extend targetObjectRef properties to labels #58

Open philippselle opened 2 years ago

philippselle commented 2 years ago

Hi, This is just an idea and maybe helpful for some use cases.

Use Case:

  1. We use the resource-locker operator to patch files via ArgoCD. We need to perform it this way, because the resources we need to patch are created by operators (e.g. service mesh) and are not stored in our git repository. To maintain our project completely in Git the resource-locker operator is a good way to go. Unfortunately some resources we need to patch will have a generated name and therefore we can not fully automate the process. Idea: as we know the label of the generated resource, it would be great to extend the targetObjectRef properties to allow patching resources with a specific label. E.g.
patches:
  - targetObjectRef:
      apiVersion: v1
      kind: ConfigMap
      labels:
        app: my-sample-app
      namespace: default

an other use case might be;

  1. Performing a mass patch on all resources of one type with the same label.

Thank you and have a good day. Philipp

raffaelespazzoli commented 2 years ago

this is a good feature to possibly have. I had planned adding it, but never got to it.