-
Epic
-
Resolution: Done
-
Normal
-
None
-
None
-
Enable an OpenAPI schema to patch/merge lists in the policy generator
-
False
-
-
False
-
Not Selected
-
To Do
-
ACM-1228 - ACM PolicyGenerator Improvements
-
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