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

V1 constrainttemplate docs #1492

Merged

Conversation

julianKatz
Copy link
Contributor

Add docs page about v1 Constraint Templates

Fixes #1476

Signed-off-by: juliankatz juliankatz@google.com

Fixes open-policy-agent#1476

Signed-off-by: juliankatz <juliankatz@google.com>
… v1-constrainttemplate-docs

Signed-off-by: juliankatz <juliankatz@google.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

Looking good! Minor editorial feedback


## `v1` Constraint Template

In release version (some version goes here), Gatekeeper included the `v1` version of `ConstraintTemplate`. Unlike past versions of `ConstraintTemplate`, `v1` requires the Constraint schema section to be [structural](https://kubernetes.io/blog/2019/06/20/crd-structural-schema/).
Copy link
Contributor

Choose a reason for hiding this comment

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

(some version goes here) -> definitely put the version here before submitting :p

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, let's lead with some of the benefits of structural schemas:

  • We're aligning with the direction K8s is headed in
  • It makes the expectation of what parameters are provided more explicit
  • It helps detect errors like a typo in the parameters, which could lead to underenforcement.

It's okay to just mention the benefits here and elaborate later.

Copy link
Member

Choose a reason for hiding this comment

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

should be 3.6.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot to add some of the things max suggested here. Will do now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

website/docs/constrainttemplates.md Outdated Show resolved Hide resolved
# Note that "labels" is now an array item, rather than an object
- labels: ["gatekeeper"]
EOF
The K8sRequiredLabels "ns-must-have-gk" is invalid: spec.parameters: Invalid value: "array": spec.parameters in body must be of type object: "array"
Copy link
Member

Choose a reason for hiding this comment

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

👍 on the example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks!

… v1-constrainttemplate-docs

Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
… v1-constrainttemplate-docs

Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
@julianKatz
Copy link
Contributor Author

@maxsmythe @ritazh This is ready for re-review. Thanks!

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

website/docs/constrainttemplates.md Outdated Show resolved Hide resolved
ritazh and others added 6 commits August 17, 2021 15:21
… v1-constrainttemplate-docs

Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
…tekeeper into v1-constrainttemplate-docs

Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
… v1-constrainttemplate-docs

Signed-off-by: juliankatz <juliankatz@google.com>
@julianKatz julianKatz merged commit c3e9cd4 into open-policy-agent:master Aug 23, 2021
@julianKatz julianKatz deleted the v1-constrainttemplate-docs branch August 23, 2021 23:51
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 changes introduced in v1 ConstraintTemplate
3 participants