Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-9437

Enable an OpenAPI schema to patch/merge lists in the policy generator

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Done
    • Icon: Normal Normal
    • ACM 2.11.0
    • None
    • GRC
    • None

      From the issue in the repo (https://github.com/open-cluster-management-io/policy-generator-plugin/issues/142):

      Kustomize can only merge list if the merge key is defined in the object's schema, but Kustomize only supports builtin k8s schema by default. So all other resources that include lists cannot be merged via strategicMerge, they are replaced instead.

      Kustomize supports merging for arbitrary CRDs if it knows the schema via the openapi option, see: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/openapi/

      Why not add an optional openapi field that would be passed below, when the manifests are patched: https://github.com/open-cluster-management-io/policy-generator-plugin/blob/cea7921cd7564dd635c46d81e910e94b8752a156/internal/patches.go#L178-L179

              showeimer Sho Weimer
              rh-ee-dhaiduce Dale Haiducek
              Derek Ho Derek Ho
              Sho Weimer Sho Weimer
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: