Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document ModifySet and assign.fromMetadata #1718

Merged
merged 3 commits into from Dec 7, 2021

Conversation

maxsmythe
Copy link
Contributor

Fixes #1702
Fixes #1700

Signed-off-by: Max Smythe smythe@google.com

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

Fixes open-policy-agent#1702
Fixes open-policy-agent#1700

Signed-off-by: Max Smythe <smythe@google.com>
@willbeason
Copy link
Member

This looks great!

Note that the `applyTo` section applies to the Assign CRD only. It allows filtering of resources by the resource GVK (group version kind). Note that the `applyTo` section does not accept globs.
Note that the `applyTo` field is required for `Assign` and `ModifySet` mutators, and does not exist for `AssignMetadata` mutators.
It allows Gatekeeper to understand the schema of the objects being modified, so that it can detect when two mutators disagree as
to a kind's schema, which can cause non-convegent mutations. Also, the `applyTo` section does not accept globs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to a kind's schema, which can cause non-convegent mutations. Also, the `applyTo` section does not accept globs.
to a kind's schema, which can cause non-convergent mutations. Also, the `applyTo` section does not accept globs.

@@ -60,25 +62,27 @@ match:
excludedNamespaces: []
```

Note that the `applyTo` section applies to the Assign CRD only. It allows filtering of resources by the resource GVK (group version kind). Note that the `applyTo` section does not accept globs.
Note that the `applyTo` field is required for `Assign` and `ModifySet` mutators, and does not exist for `AssignMetadata` mutators.
It allows Gatekeeper to understand the schema of the objects being modified, so that it can detect when two mutators disagree as
Copy link
Member

@sozercan sozercan Dec 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clarify initial "it" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to applyTo

The extent of changes section describes the resource which will be mutated.
It allows to filter the resources to be mutated by kind, label and namespace.
The extent of changes section describes which resources will be mutated.
It allows selecting resources to be mutated using the same match critia
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It allows selecting resources to be mutated using the same match critia
It allows selecting resources to be mutated using the same match criteria

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small spelling nits otherwise LGTM. Thank you!

Signed-off-by: Max Smythe <smythe@google.com>
@maxsmythe
Copy link
Contributor Author

Thanks for the review!

@maxsmythe maxsmythe merged commit 9ee0f00 into open-policy-agent:master Dec 7, 2021
priyamshet pushed a commit to priyamshet/gatekeeper-1 that referenced this pull request Dec 14, 2021
* Document ModifySet and assign.fromMetadata

Fixes open-policy-agent#1702
Fixes open-policy-agent#1700

Signed-off-by: Max Smythe <smythe@google.com>

* Fix spelling errors

Signed-off-by: Max Smythe <smythe@google.com>
Signed-off-by: Priya Shetpriya.shet@gmail.com <priya.shet@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

document mutation fromMetadata add docs for modifySet
3 participants