Skip to content

Commit

Permalink
configure the sweeper to clean up firewall rules that are leftover (G…
Browse files Browse the repository at this point in the history
…oogleCloudPlatform#5202)

* configure the sweeper to clean up firewall rules that are leftover from k8 stuff

* add information on which test is being skipped

* Update gcp_sweeper_test.go

add explanation for resource prefix
  • Loading branch information
ScottSuarez authored and khajduczenia committed Oct 12, 2021
1 parent 8129472 commit b965567
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ func skipIfEnvNotSet(t *testing.T, envs ...string) {

for _, k := range envs {
if os.Getenv(k) == "" {
log.Printf("[DEBUG] Warning - environment variable %s is not set - skipping test %s", k, t.Name())
t.Skipf("Environment variable %s is not set", k)
}
}
Expand Down
1 change: 1 addition & 0 deletions mmv1/third_party/terraform/utils/gcp_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var testResourcePrefixes = []string{
"df-", // https://github.com/hashicorp/terraform-provider-google/issues/8909
"resourcegroup-", // https://github.com/hashicorp/terraform-provider-google/issues/8924
"cluster-", // https://github.com/hashicorp/terraform-provider-google/issues/8924
"k8s-fw-", // firewall rules are getting created and not cleaned up by k8 resources using this prefix
}

func TestMain(m *testing.M) {
Expand Down

0 comments on commit b965567

Please sign in to comment.