Skip to content

Commit

Permalink
test: Delete hubble-ca-secret when cleaning up
Browse files Browse the repository at this point in the history
Remove hubble-ca-secret when cleaning up Cilium components. This may help
avoid test fails installing Cilium with this error message:

  Error: rendered manifests contain a resource that already
  exists. Unable to continue with install: existing resource conflict:
  kind: Secret, namespace: kube-system, name: hubble-ca-secret

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
  • Loading branch information
jrajahalme committed Oct 15, 2021
1 parent 859228d commit e80a607
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/helpers/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -4388,7 +4388,11 @@ func (kub *Kubectl) DelIPRoute(nodeName, subnet, gw string) *CmdRes {
return kub.ExecInHostNetNS(context.TODO(), nodeName, cmd)
}

// CleanupCiliumComponents removes all the cilium related components from the cluster.
// CleanupCiliumComponents removes all the cilium related components from the cluster, including CRDs.
// This means that CiliumNode resources get deleted, too. This causes any new Cilium nodes to get
// reassigned IP allocation pools, which may be different than before. This then causes all endpoints
// to fail restore and get in a bad shape. This means that all Cilium-managed pods must also be deleted
// when this is called!
// This is best effort, any error occurring when deleting resources is ignored.
func (kub *Kubectl) CleanupCiliumComponents() {
ginkgoext.By("Cleaning up Cilium components")
Expand All @@ -4404,7 +4408,7 @@ func (kub *Kubectl) CleanupCiliumComponents() {
"clusterrole": "cilium cilium-operator hubble-relay",
"serviceaccount": "cilium cilium-operator hubble-relay",
"service": "cilium-agent hubble-metrics hubble-relay",
"secret": "hubble-relay-client-certs hubble-server-certs",
"secret": "hubble-relay-client-certs hubble-server-certs hubble-ca-secret",
"resourcequota": "cilium-resource-quota cilium-operator-resource-quota",
}

Expand Down

0 comments on commit e80a607

Please sign in to comment.