Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Allows kube-system to be orphaned when deleting metrics-server #4724

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

adduarte
Copy link

@adduarte adduarte commented Jun 6, 2022

When the metrics-server is installed it might add the kube-system namespace
to its list of resources. Subsequently, when the metrics-server is deleted,
it will try to delete the kube-system namespace, but this is not allowed so
package deletion fails.

This patch makes it possible to delete the metrics-server package without
having to delete the kube-system namespace.

Which issue(s) this PR fixes

Fixes: vmware-tanzu/tanzu-framework#1708

Describe testing done for PR

Deployed kind cluster with following commands:
#!/bin/bash -ex
kind create cluster --name v0.34.0
kubectl cluster-info --context kind-v0.34.0
kubectl create namespace vmware-system-tkg
kubectl apply -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/download/v0.34.0/release.yml

Then proceeded to install current version of metrics-server pacakge (0.5.1)
with image: projects.registry.vmware.com/tce/metrics-server@sha256:4fa580c9b185d44f39847cd2347c8110b3a38d775e674ce77bc3b2569067f4c0
(this image has the problem).

The proceeded to update the Package CR to a version/image containing this fix
after succesful reconciliation, pacakgeinstall was deleted succesfully. PackageInstall cannot be deleted without this fix

Special notes for your reviewer

When the metrics-server is installed it might add the kube-system namespace
to its list of resources. Subsequently, when the metrics-server is deleted,
it will try to delete the kube-system namespace, but this is not allowed so
package deletion fails.

This patch makes it possible to delete the metrics-server package without
having to delete the kube-system namespace.
@adduarte adduarte requested a review from a team as a code owner June 6, 2022 22:51
@github-actions github-actions bot added the owner/packages Work executed by a package's maintainer label Jun 6, 2022
@adduarte adduarte marked this pull request as draft June 6, 2022 22:52
@adduarte adduarte marked this pull request as ready for review June 7, 2022 20:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/packages cla-not-required owner/packages Work executed by a package's maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metrics-package should not have createNamespace:true for kube-system
4 participants