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

✨ Clean-up installed CRDs on Stop() #697

Merged

Conversation

pires
Copy link
Contributor

@pires pires commented Nov 26, 2019

But only if USE_EXISTING_CLUSTER is set to true as there's no point in doing it if the control-plane is going away.

Fixes #420

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 26, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @pires. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 26, 2019
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 26, 2019
@pires
Copy link
Contributor Author

pires commented Nov 30, 2019

Maybe you can take a look at this one, @alvaroaleman? Please!

pkg/envtest/server.go Outdated Show resolved Hide resolved
pkg/envtest/crd.go Show resolved Hide resolved
pkg/envtest/envtest_test.go Show resolved Hide resolved
@gerred
Copy link
Contributor

gerred commented Dec 3, 2019

After the fixes, this looks good! Thanks @pires

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 3, 2019
@gerred
Copy link
Contributor

gerred commented Dec 3, 2019

/ok-to-test

@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 Dec 3, 2019
@gerred
Copy link
Contributor

gerred commented Dec 3, 2019

looks like the teardown code is removing the CRDs as well which is why that test is failing? so uninstallCRDs runs but the suite harness is trying to do the same thing.

/lgtm cancel

PR itself looks ok pending fixing that test. :)

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 3, 2019
@pires
Copy link
Contributor Author

pires commented Dec 4, 2019

Well, I can re-install the CRDs so the AfterEach is happy or I can add a validation to said func that tries to delete only if CRD is present. I'll go with the latter for now and change later if you're not pleased with that solution.

@gerred
Copy link
Contributor

gerred commented Dec 4, 2019

Latter sounds good 👍 thanks @pires!

@pires pires force-pushed the pires/delete_crds_on_stop branch 2 times, most recently from 10f47a0 to 841a035 Compare December 4, 2019 15:56
But only if USE_EXISTING_CLUSTER is set to true as there's no point in doing it
if the control-plane is going away.

Signed-off-by: Pires <pjpires@gmail.com>
@pires
Copy link
Contributor Author

pires commented Dec 4, 2019

Sorry for the few force-pushes but stupid me was working from a different machine that didn't had my latest changes and that took me a while to figure out 🤦‍♂

Signed-off-by: Pires <pjpires@gmail.com>
pkg/envtest/envtest_test.go Show resolved Hide resolved
pkg/envtest/server.go Outdated Show resolved Hide resolved
Signed-off-by: Pires <pjpires@gmail.com>
Copy link
Member

@alvaroaleman alvaroaleman 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 Dec 4, 2019
@DirectXMan12
Copy link
Contributor

/approve

thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, pires

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 Dec 4, 2019
@k8s-ci-robot k8s-ci-robot merged commit a0e9c1d into kubernetes-sigs:master Dec 4, 2019
@pires pires deleted the pires/delete_crds_on_stop branch December 4, 2019 22:36
DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

envtest.Environment should cleanup CRDs on Stop()
5 participants