Skip to content

Commit

Permalink
fix(destroy): only delete e2e-* namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bostrt committed Jun 30, 2022
1 parent 40ebdcb commit 8468a66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/destroy/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

const (
DeleteSonobuoyEnvWaitTime = time.Hour * 1
NonOpenShiftNamespace = "(openshift)|(kube-(system|public|node-lease))|(default)"
NonOpenShiftNamespace = "e2e-.*"
)

type DestroyOptions struct {
Expand Down Expand Up @@ -106,7 +106,7 @@ func (d *DestroyOptions) DeleteTestNamespaces() error {
var nonOpenShiftNamespaces []string
pattern := regexp.MustCompile(NonOpenShiftNamespace)
for _, ns := range nsList.Items {
if !pattern.MatchString(ns.Name) {
if pattern.MatchString(ns.Name) {
log.Infof("stale namespace was found: %s, removing...", ns.Name)
nonOpenShiftNamespaces = append(nonOpenShiftNamespaces, ns.Name)
}
Expand Down

0 comments on commit 8468a66

Please sign in to comment.