cluster-api-provider-aws
cluster-api-provider-aws copied to clipboard
deleting additional vpc cni resources when disabled
What type of PR is this? /kind bug
What this PR does / why we need it:
Adds additional logic to removing vpc-cni pre-installed resources when you set disableVPCCNI to true. Previous logic only deleted the aws-node DaemonSet when in reality there are ServiceAccounts, ClusterRole, ClusterRoleBinding and a CRD.
New logic deletes the SA/CR/CRB but leaves the CRD and any CRs. This is important because some people manage the VPC CNI via the helm chart and with these pieces around the chart fails to install citing the SA/CR/CRB already existing. Additionally... if you choose to disable vpc-cni through capa and install via helm, capa would continually smash it out of existing during reconciliation so added a check for managed-by: Helm
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3729
Special notes for your reviewer: I tested this pretty thoroughly, check the issue for more details but the basics are this is pretty bullet proof for cycling back/forth from disableVPCCNI to installing the addon again.
Checklist:
- [ ] squashed commits
- [ ] includes documentation
- [ ] adds unit tests
- [ ] adds or updates e2e tests
Hi @luthermonson. 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.
/ok-to-test
/test pull-cluster-api-provider-aws-test
/test pull-cluster-api-provider-aws-test
/hold until https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3720 is merged. All upcoming PRs need to be merged once v1beta2 API types are in.
/hold cancel
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Skarlso
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [Skarlso]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment