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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Remove unneeded caBundle value from webhook patches (V3 only) #1699

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

matthchr
Copy link
Contributor

@matthchr matthchr commented Sep 29, 2020

Instead of having a dummy value in caBundle, (caBundle: Cg==), instead just omit that field entirely as it is not required.
Doing this means that repeated kubectl apply operators on a CRD work better, in accordance with the documented behavior of apply and how it considers last-applied-configuration, since they do not change the resourceVersion of the CRD.

This fixes #1684.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 29, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @matthchr!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 馃帀. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubebuilder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 馃槂

@k8s-ci-robot
Copy link
Contributor

Hi @matthchr. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 29, 2020
@matthchr

This comment has been minimized.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Sep 29, 2020
@matthchr matthchr changed the title Remove dummy caBundle value from webhook patches Remove unneeded caBundle value from webhook patches Sep 29, 2020
@matthchr matthchr changed the title Remove unneeded caBundle value from webhook patches 馃悰 Remove unneeded caBundle value from webhook patches Sep 29, 2020
@matthchr matthchr changed the title 馃悰 Remove unneeded caBundle value from webhook patches 馃悰 Remove unneeded caBundle value from webhook patches Sep 29, 2020
@matthchr
Copy link
Contributor Author

@DirectXMan12 can you weigh in when you get a chance on the question I asked above about the files that still have Cg== in them?

@DirectXMan12
Copy link
Contributor

hmm... @camilamacedo86 would know that better, but make generate should be generating everything. If you delete those files do they get recreated?

@matthchr
Copy link
Contributor Author

Yeah, if I delete those files they are in fact regenerated (and they have Cg== in them). I'm not sure where it's coming from though as the only place that has Cg== is those files.

~/go/src/sigs.k8s.io/kubebuilde $ grep -rEli "Cg==" *

testdata/project-v2/config/webhook/manifests.yaml
testdata/project-v2-multigroup/config/webhook/manifests.yaml
testdata/project-v3/config/webhook/manifests.yaml
testdata/project-v3-multigroup/config/webhook/manifests.yaml

I must be missing someplace - will look through how make generate is making those files.

@matthchr
Copy link
Contributor Author

I think it's being created by controller-tools here?

Looks like maybe I need to send a PR there as well? Not entirely sure how to coordinate between the two repos - maybe controller_tools needs to merge first?

@DirectXMan12
Copy link
Contributor

yeah, just file a PR on controller-tools. You can either merge that first, or merge this then file another PR here to update the CT version in v3 & update the golden files.

@matthchr
Copy link
Contributor Author

matthchr commented Oct 1, 2020

I've sent a PR for controller-tools too.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Oct 2, 2020

Hi @matthchr,

The make generate will remove the testdata/ directory and re-generate all projects. We ought to run that when we change anything in the templates. since we also ought to perform changes in pkg/plugin/v3/ the project-v2-* samples should not change as well.

  - Only removing in v3 as v2 isn't accepting changes.
@matthchr matthchr changed the title 馃悰 Remove unneeded caBundle value from webhook patches 馃悰 Remove unneeded caBundle value from webhook patches (V3 only) Oct 2, 2020
@camilamacedo86
Copy link
Member

/ok-to-test
/approve

It shows ok for me 馃憤
really tks for your contribution. we need more +1 OK to get it merged.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 2, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2020
@camilamacedo86
Copy link
Member

/test pull-kubebuilder-e2e-k8s-1-15-3

@matthchr
Copy link
Contributor Author

matthchr commented Oct 2, 2020

@camilamacedo86 - it looks like a test timed out in the v2 tests... I don't think I changed anything there though (it was all reverted).

Is this just a flaky test?

@camilamacedo86
Copy link
Member

/test pull-kubebuilder-e2e-k8s-1-14-1

@matthchr
Copy link
Contributor Author

@camilamacedo86 @DirectXMan12 - pinging on this, would be good to get it merged now that the controller-tools PR has merged.

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

.

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 20, 2020
@kubernetes-sigs kubernetes-sigs deleted a comment from k8s-ci-robot Oct 20, 2020
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/approve

It shows ok for me. 馃憤

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, matthchr

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:

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 20, 2020
@camilamacedo86
Copy link
Member

camilamacedo86 commented Oct 20, 2020

I understand that we can

/lgtm

this one.
It was done in the controller-tools already too. Also, it is done only for v3+ and was checked and drove by @DirectXMan12 as well.

@camilamacedo86
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 20, 2020
@k8s-ci-robot k8s-ci-robot merged commit 1c04fab into kubernetes-sigs:master Oct 20, 2020
@matthchr matthchr deleted the feature/fix-cabundle branch October 20, 2020 17:34
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reapplying CRD yaml with conversion webhook enabled causes unexpected CRD resourceVersion update
4 participants