Skip to content

Commit

Permalink
ci: Exclude soak-periodic-2213793 Cluster from cleanup for Windows …
Browse files Browse the repository at this point in the history
…investigation (#5910)
  • Loading branch information
engedaam authored Mar 20, 2024
1 parent 46ec68e commit 466484f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions test/hack/resource/clean/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ import (

const sweeperCleanedResourcesTableName = "sweeperCleanedResources"

var excludedClusters = []string{}
var excludedClusters = []string{
"soak-periodic-2213793",
}

func main() {
expiration := flag.String("expiration", "12h", "define the expirationTTL of the resources")
Expand Down Expand Up @@ -82,7 +84,7 @@ func main() {
// If there's no cluster defined, clean up all expired resources. otherwise, only cleanup the resources associated with the cluster
if lo.FromPtr(clusterName) == "" {
ids, err = resourceTypes[i].GetExpired(ctx, expirationTime, excludedClusters)
} else if !slices.Contains(excludedClusters, *clusterName) {
} else if !slices.Contains(excludedClusters, lo.FromPtr(clusterName)) {
ids, err = resourceTypes[i].Get(ctx, lo.FromPtr(clusterName))
}
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/hack/resource/pkg/resourcetypes/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (i *Instance) GetExpired(ctx context.Context, expirationTime time.Time, exc
for _, res := range out.Reservations {
for _, instance := range res.Instances {
clusterName, found := lo.Find(instance.Tags, func(tag ec2types.Tag) bool {
return *tag.Key == k8sClusterTag
return *tag.Key == karpenterTestingTag
})
if found && slices.Contains(excludedClusters, lo.FromPtr(clusterName.Value)) {
continue
Expand Down
2 changes: 1 addition & 1 deletion test/hack/resource/pkg/resourcetypes/securitygroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (sg *SecurityGroup) GetExpired(ctx context.Context, expirationTime time.Tim

for _, sgroup := range out.SecurityGroups {
clusterName, found := lo.Find(sgroup.Tags, func(tag ec2types.Tag) bool {
return *tag.Key == k8sClusterTag
return *tag.Key == karpenterTestingTag
})
if found && slices.Contains(excludedClusters, lo.FromPtr(clusterName.Value)) {
continue
Expand Down
2 changes: 1 addition & 1 deletion test/hack/resource/pkg/resourcetypes/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *Stack) GetExpired(ctx context.Context, expirationTime time.Time, exclud
})
for _, stack := range stacks {
clusterName, found := lo.Find(stack.Tags, func(tag cloudformationtypes.Tag) bool {
return *tag.Key == k8sClusterTag
return *tag.Key == karpenterTestingTag
})
if found && slices.Contains(excludedClusters, lo.FromPtr(clusterName.Value)) {
continue
Expand Down

0 comments on commit 466484f

Please sign in to comment.