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

Add a CreationTimePatchConfiguration CRD

Open QuingKhaos opened this issue 3 years ago • 0 comments

Instead of manually configuring the creation-time patch webhook, the patch-operator controller could provide a CreationTimePatch CRD and a controller, which watches those CRs and configures the webhook accordingly.

apiVersion: redhatcop.redhat.io/v1alpha1
kind: CreationTimePatchConfiguration
metadata:
  name: example
spec:
  rules:
    - apiVersion: v1
      resources:
        - configmaps
        - secrets
    - apiVersion: binding.operators.coreos.com/v1alpha1
      resources:
        - servicebindings

I would suggest to support multiple CreationTimePatchConfiguration CRs, which are then consolidated into a single webhook configuration, but having a singleton CRD is also okay.

Multiple CRs would support the use-case were I can configure a new CRD created by some operator installed in the same GitOps subproject/subdir which installed the other operator and don't have to modify another place to support that. But this may be an advanced use-case and not sure how easy it is to map multiple CRs to one resource in the end.

QuingKhaos avatar Aug 03 '22 12:08 QuingKhaos