Skip to content

Commit

Permalink
Merge pull request #145 from alebedev87/fix-e2e-waf-acl-name-clash
Browse files Browse the repository at this point in the history
NO-JIRA: e2e: Add unix timestamp to WAF ACL names to avoid conflicts
  • Loading branch information
alebedev87 authored Dec 18, 2024
2 parents 82a317a + 770bfed commit ea53812
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/e2e/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ func TestAWSLoadBalancerControllerWithWAFv2(t *testing.T) {
var aclARN string
if !stsModeRequested() {
wafClient := wafv2.NewFromConfig(cfg)
webACLName := "echoserver-acl"
webACLName := fmt.Sprintf("echoserver-acl-%d", time.Now().Unix())
acl, err := findAWSWebACL(wafClient, webACLName)
if err != nil {
t.Logf("failed to find %q aws wafv2 acl due to %v, continue to creation anyway", webACLName, err)
Expand Down Expand Up @@ -726,10 +726,11 @@ func TestAWSLoadBalancerControllerWithWAFRegional(t *testing.T) {
if err != nil {
t.Fatalf("failed to get change token for waf regional classic %v", err)
}
aclName := fmt.Sprintf("echoserverclassicacl%d", time.Now().Unix())
acl, err := wafClient.CreateWebACL(context.TODO(), &waf.CreateWebACLInput{
DefaultAction: &waftypes.WafAction{Type: waftypes.WafActionTypeBlock},
MetricName: aws.String("echoserverclassicacl"),
Name: aws.String("echoserverclassicacl"),
MetricName: aws.String(aclName),
Name: aws.String(aclName),
ChangeToken: token.ChangeToken,
})
if err != nil {
Expand Down

0 comments on commit ea53812

Please sign in to comment.