Skip to content

Commit

Permalink
Update preLoad namespace selector
Browse files Browse the repository at this point in the history
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 <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed Mar 10, 2022
1 parent b41d122 commit 6d57a25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/burner/pre_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6d57a25

Please sign in to comment.