Skip to content

Add kustomize rule for commonAnnotations on CRD #62

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

Conversation

ArangoGutierrez
Copy link
Contributor

@ArangoGutierrez ArangoGutierrez commented Apr 16, 2021

Currently make manifests resets the CRD file removing a needed
annotation

  • api-approved.kubernetes.io: "unapproved, experimental-only"

this patch overrides this autogeneration by adding a kustomize rule commonAnnotations into
config/crd/kustomization.yaml file, allowing kustomize to patch the crd
when kustomize build config/default is called, injecting the
annotation.

Signed-off-by: Carlos Eduardo Arango Gutierrez [email protected]

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 16, 2021
@k8s-ci-robot k8s-ci-robot requested review from marquiz and zvonkok April 16, 2021 00:52
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 16, 2021
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Didn't work as expected. Annotation was still missing after I ran make manifests

@ArangoGutierrez
Copy link
Contributor Author

Didn't work as expected. Annotation was still missing after I ran make manifests

I think I was short on explanation on this PR , going to edit the description

Currently `mkae manifests` resets the CRD file removing a needed
annotation
- api-approved.kubernetes.io: "unapproved, experimental-only"

this patch overrides this autogeneration by adding a kustomize rule commonAnnotations into
config/crd/kustomization.yaml file, allowing kustomize to patch the crd
when `kustomize build config/default` is called, injecting the
annotation.

Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
@ArangoGutierrez ArangoGutierrez force-pushed the devel/customannotation_crd branch from 806ec9b to 369c782 Compare April 16, 2021 19:07
@ArangoGutierrez ArangoGutierrez requested a review from marquiz April 16, 2021 19:08
@@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
api-approved.kubernetes.io: "unapproved, experimental-only"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, is not needed any more, we can now host the default yaml we get from make manifest and count on kustomize to apply annotation when make deploy

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

👍

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 19, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

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 [ArangoGutierrez,marquiz]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 14a5b48 into kubernetes-sigs:master Apr 19, 2021
@marquiz marquiz mentioned this pull request Oct 26, 2021
13 tasks
@ArangoGutierrez ArangoGutierrez deleted the devel/customannotation_crd branch March 13, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants