open-cluster-management-io / policy-generator-plugin

A Kustomize generator plugin to generate Open Cluster Management policies
Apache License 2.0
29 stars 31 forks source link

Add support for patching manifests #11

Closed mprahl closed 3 years ago

mprahl commented 3 years ago

This adds support for patching manifests that are wrapped in a policy. This uses Kustomize internally, and thus the patches must be in the format of Kustomize patches. An exception is that if the patches are applied to only a single manifest, the apiVersion, kind, metadata.name, and metadata.namespace fields are not necessary. They will be copied over from the manifest before the patches are applied using Kustomize.

mprahl commented 3 years ago

@dhaiducek and @ChunxiAlexLuo, I had to refactor some functions for this change and those changes are separated by commits, so it's easier to review this PR commit by commit.

mprahl commented 3 years ago

@ChunxiAlexLuo thanks for the review! Could you please take another look? Here is the diff: https://github.com/open-cluster-management/policy-generator-plugin/compare/9de0e28ea3ae7b38a7ed7ef0e1c0352d9e428fc6..e3386e178584bf3ac8a0ef32f1ad36edd73bc7d7

openshift-ci[bot] commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ChunxiAlexLuo, mprahl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/open-cluster-management/policy-generator-plugin/blob/main/OWNERS)~~ [ChunxiAlexLuo,mprahl] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment