From 6d57a25fbbb375f03983603f5a2637d9cca4b9fe Mon Sep 17 00:00:00 2001 From: Raul Sevilla Date: Thu, 10 Mar 2022 17:15:46 +0100 Subject: [PATCH] Update preLoad namespace selector Older k8s versions does not create the previous label, so the preLoad namespace it's not deleted after the preLoad period Signed-off-by: Raul Sevilla --- pkg/burner/pre_load.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/burner/pre_load.go b/pkg/burner/pre_load.go index ca86a1beb..c020e0420 100644 --- a/pkg/burner/pre_load.go +++ b/pkg/burner/pre_load.go @@ -39,7 +39,7 @@ func PreLoadImages(job Executor) { log.Infof("Pre-load: Sleeping for %v", job.Config.PreLoadPeriod) time.Sleep(job.Config.PreLoadPeriod) log.Infof("Pre-load: Deleting namespace %s", preLoadNs) - CleanupNamespaces(ClientSet, v1.ListOptions{LabelSelector: fmt.Sprintf("kubernetes.io/metadata.name=%s", preLoadNs)}) + CleanupNamespaces(ClientSet, v1.ListOptions{LabelSelector: "kube-burner-preload=yes"}) } func getJobImages(job Executor) ([]string, error) { @@ -72,7 +72,7 @@ func getJobImages(job Executor) ([]string, error) { } func createDSs(imageList []string) error { - if err := createNamespace(ClientSet, preLoadNs, map[string]string{}); err != nil { + if err := createNamespace(ClientSet, preLoadNs, map[string]string{"kube-burner-preload": "true"}); err != nil { log.Fatal(err) } for i, image := range imageList {