From ccac0a1b32e9b508ba5111c916f9f815ff80407b Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Sat, 16 Sep 2023 16:09:50 -0700 Subject: [PATCH] Validating labels of k8s resources in functional tests --- test/validation/k8s.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/test/validation/k8s.go b/test/validation/k8s.go index a75c33d1778..479529dbecd 100644 --- a/test/validation/k8s.go +++ b/test/validation/k8s.go @@ -74,8 +74,9 @@ func NewK8sPodForResource(application string, name string) K8sObject { Version: "v1", Resource: "pods", }, - Kind: "Pod", - Labels: kuberneteskeys.MakeSelectorLabels(application, name), + Kind: "Pod", + Labels: kuberneteskeys.MakeSelectorLabels(application, name), + ResourceName: name, } } @@ -94,8 +95,9 @@ func NewK8sHTTPProxyForResource(application string, name string) K8sObject { Version: "v1", Resource: "httpproxies", }, - Kind: "HTTPProxy", - Labels: kuberneteskeys.MakeSelectorLabels(application, name), + Kind: "HTTPProxy", + Labels: kuberneteskeys.MakeSelectorLabels(application, name), + ResourceName: name, } } @@ -107,8 +109,9 @@ func NewK8sServiceForResource(application string, name string) K8sObject { Version: "v1", Resource: "services", }, - Kind: "Service", - Labels: kuberneteskeys.MakeSelectorLabels(application, name), + Kind: "Service", + Labels: kuberneteskeys.MakeSelectorLabels(application, name), + ResourceName: name, } } @@ -120,8 +123,9 @@ func NewK8sSecretForResource(application string, name string) K8sObject { Version: "v1", Resource: "secrets", }, - Kind: "Secret", - Labels: kuberneteskeys.MakeSelectorLabels(application, name), + Kind: "Secret", + Labels: kuberneteskeys.MakeSelectorLabels(application, name), + ResourceName: name, } } @@ -602,7 +606,8 @@ func NewDaprComponent(application string, name string) K8sObject { Version: "v1alpha1", Resource: "components", }, - Kind: "Component", - Labels: kuberneteskeys.MakeSelectorLabels(application, name), + Kind: "Component", + Labels: kuberneteskeys.MakeSelectorLabels(application, name), + ResourceName: name, } }