diff --git a/tests/e2e/network/service_annotations.go b/tests/e2e/network/service_annotations.go index 249dc6f3a7..2f068ec1f0 100644 --- a/tests/e2e/network/service_annotations.go +++ b/tests/e2e/network/service_annotations.go @@ -1415,6 +1415,9 @@ func waitComparePIPTags(tc *utils.AzureTestClient, expectedTags map[string]*stri delete(tags, consts.LegacyClusterNameKey) delete(tags, consts.ServiceTagKey) delete(tags, consts.LegacyServiceTagKey) + for _, k := range utils.UnwantedTagKeys { + delete(tags, k) + } printTags := func(name string, ts map[string]*string) { msg := "" diff --git a/tests/e2e/utils/network_utils.go b/tests/e2e/utils/network_utils.go index cacca0f22e..146ea4d4c0 100644 --- a/tests/e2e/utils/network_utils.go +++ b/tests/e2e/utils/network_utils.go @@ -46,6 +46,8 @@ var ( false: "", true: "-IPv6", } + + UnwantedTagKeys = []string{"DateCreated"} ) // getVirtualNetworkList returns the list of virtual networks in the cluster resource group. @@ -287,9 +289,19 @@ func WaitCreatePIP(azureTestClient *AzureTestClient, ipName, rgName string, ipPa } return pip.Properties.IPAddress != nil, nil }) + if err == nil { + pip.Tags = cleanupTags(pip.Tags, UnwantedTagKeys) + } return pip, err } +func cleanupTags(tags map[string]*string, unwantedKeys []string) map[string]*string { + for _, key := range unwantedKeys { + delete(tags, key) + } + return tags +} + func WaitCreatePIPPrefix( cli *AzureTestClient, name, rgName string, @@ -414,6 +426,9 @@ func WaitGetPIP(azureTestClient *AzureTestClient, ipName string) (pip *aznetwork } return true, nil }) + if err == nil { + pip.Tags = cleanupTags(pip.Tags, UnwantedTagKeys) + } return }