diff --git a/functional_tests/duplicate_ports.json b/functional_tests/duplicate_ports.json index 77b2920a3..c9f272326 100644 --- a/functional_tests/duplicate_ports.json +++ b/functional_tests/duplicate_ports.json @@ -240,7 +240,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/health_probes_same_labels_different_namespaces.json b/functional_tests/health_probes_same_labels_different_namespaces.json index c243f1d04..633e18c7e 100644 --- a/functional_tests/health_probes_same_labels_different_namespaces.json +++ b/functional_tests/health_probes_same_labels_different_namespaces.json @@ -313,7 +313,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/one_ingress_https_backend.json b/functional_tests/one_ingress_https_backend.json index fe271c209..d0f8c723d 100644 --- a/functional_tests/one_ingress_https_backend.json +++ b/functional_tests/one_ingress_https_backend.json @@ -282,7 +282,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/one_ingress_https_backend_without_backend_protocol.json b/functional_tests/one_ingress_https_backend_without_backend_protocol.json index 4456c9cf9..d86428d2d 100644 --- a/functional_tests/one_ingress_https_backend_without_backend_protocol.json +++ b/functional_tests/one_ingress_https_backend_without_backend_protocol.json @@ -206,7 +206,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/one_ingress_slash_nothing.json b/functional_tests/one_ingress_slash_nothing.json index a2c38433d..0b727840b 100644 --- a/functional_tests/one_ingress_slash_nothing.json +++ b/functional_tests/one_ingress_slash_nothing.json @@ -176,7 +176,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/one_ingress_slash_slashnothing.json b/functional_tests/one_ingress_slash_slashnothing.json index 5b8010b48..083396c94 100644 --- a/functional_tests/one_ingress_slash_slashnothing.json +++ b/functional_tests/one_ingress_slash_slashnothing.json @@ -249,7 +249,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/one_ingress_with_multiple_path_rules.json b/functional_tests/one_ingress_with_multiple_path_rules.json index e1e6af4c7..aef536a2a 100644 --- a/functional_tests/one_ingress_with_multiple_path_rules.json +++ b/functional_tests/one_ingress_with_multiple_path_rules.json @@ -325,7 +325,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/three_ingresses.json b/functional_tests/three_ingresses.json index 93ab305a9..734ed27b9 100644 --- a/functional_tests/three_ingresses.json +++ b/functional_tests/three_ingresses.json @@ -405,7 +405,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/two_ingresses_same_domain_tls_notls.json b/functional_tests/two_ingresses_same_domain_tls_notls.json index 2e7d330ef..46e9e18c1 100644 --- a/functional_tests/two_ingresses_same_domain_tls_notls.json +++ b/functional_tests/two_ingresses_same_domain_tls_notls.json @@ -313,7 +313,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/two_ingresses_same_hostname_value_different_locations.json b/functional_tests/two_ingresses_same_hostname_value_different_locations.json index e71aa0d66..f7d98f25f 100644 --- a/functional_tests/two_ingresses_same_hostname_value_different_locations.json +++ b/functional_tests/two_ingresses_same_hostname_value_different_locations.json @@ -234,7 +234,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/two_ingresses_slash_slashsomething.json b/functional_tests/two_ingresses_slash_slashsomething.json index 5b8010b48..083396c94 100644 --- a/functional_tests/two_ingresses_slash_slashsomething.json +++ b/functional_tests/two_ingresses_slash_slashsomething.json @@ -249,7 +249,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/two_ingresses_with_and_without_extended_hostname.json b/functional_tests/two_ingresses_with_and_without_extended_hostname.json index 2a08043c6..135b9e00c 100644 --- a/functional_tests/two_ingresses_with_and_without_extended_hostname.json +++ b/functional_tests/two_ingresses_with_and_without_extended_hostname.json @@ -309,7 +309,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/functional_tests/waf_annotation.json b/functional_tests/waf_annotation.json index c7569f148..bc3a629b6 100644 --- a/functional_tests/waf_annotation.json +++ b/functional_tests/waf_annotation.json @@ -255,7 +255,6 @@ }, "tags": { "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", - "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", "managed-by-k8s-ingress": "a/b/c" } } \ No newline at end of file diff --git a/pkg/appgw/appgw_test.go b/pkg/appgw/appgw_test.go index cc5bda01b..b0d411203 100644 --- a/pkg/appgw/appgw_test.go +++ b/pkg/appgw/appgw_test.go @@ -386,11 +386,10 @@ var _ = Describe("Tests `appgw.ConfigBuilder`", func() { } // Check tags - Expect(len(appGW.Tags)).To(Equal(3)) + Expect(len(appGW.Tags)).To(Equal(2)) expected := map[string]*string{ - tags.ManagedByK8sIngress: to.StringPtr("a/b/c"), - tags.IngressForAKSClusterID: to.StringPtr("/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname"), - tags.LastUpdatedByK8sIngress: to.StringPtr("2009-11-17 20:34:58.651387237 +0000 UTC"), + tags.ManagedByK8sIngress: to.StringPtr("a/b/c"), + tags.IngressForAKSClusterID: to.StringPtr("/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname"), } Expect(appGW.Tags).To(Equal(expected)) } diff --git a/pkg/appgw/configbuilder.go b/pkg/appgw/configbuilder.go index 802b5ca8f..b005b2cdf 100644 --- a/pkg/appgw/configbuilder.go +++ b/pkg/appgw/configbuilder.go @@ -11,10 +11,10 @@ import ( n "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" "github.com/Azure/go-autorest/autorest/to" - "k8s.io/klog/v2" v1 "k8s.io/api/core/v1" "k8s.io/api/extensions/v1beta1" "k8s.io/client-go/tools/record" + "k8s.io/klog/v2" "github.com/Azure/application-gateway-kubernetes-ingress/pkg/annotations" "github.com/Azure/application-gateway-kubernetes-ingress/pkg/azure" @@ -255,7 +255,6 @@ func (c *appGwConfigBuilder) addTags() { } else { klog.V(5).Infof("Error while parsing cluster resource ID for tagging: %s", err) } - c.appGw.Tags[tags.LastUpdatedByK8sIngress] = to.StringPtr(c.clock.Now().String()) } // GetVersion returns a string representing the version of AGIC. diff --git a/pkg/appgw/configbuilder_test.go b/pkg/appgw/configbuilder_test.go index f8566b8ab..c91c82737 100644 --- a/pkg/appgw/configbuilder_test.go +++ b/pkg/appgw/configbuilder_test.go @@ -422,7 +422,6 @@ var _ = Describe("Tests `appgw.ConfigBuilder`", func() { -- }, -- "tags": { -- "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", --- "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", -- "managed-by-k8s-ingress": "a/b/c" -- } --}` @@ -655,7 +654,6 @@ var _ = Describe("Tests `appgw.ConfigBuilder`", func() { -- }, -- "tags": { -- "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", --- "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", -- "managed-by-k8s-ingress": "a/b/c" -- } --}` @@ -935,7 +933,6 @@ var _ = Describe("Tests `appgw.ConfigBuilder`", func() { -- }, -- "tags": { -- "ingress-for-aks-cluster-id": "/subscriptions/subid/resourcegroups/aksresgp/providers/Microsoft.ContainerService/managedClusters/aksname", --- "last-updated-by-k8s-ingress": "2009-11-17 20:34:58.651387237 +0000 UTC", -- "managed-by-k8s-ingress": "a/b/c" -- } --}`