From 02cf941139e5774a41fc512d2031f80dcb61ae2d Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros Date: Tue, 12 Nov 2024 12:39:33 +0100 Subject: [PATCH] update tests Signed-off-by: Coleen Iona Quadros --- cicd-scripts/setup-e2e-tests.sh | 1 + tests/pkg/utils/mco_deploy.go | 23 ----------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/cicd-scripts/setup-e2e-tests.sh b/cicd-scripts/setup-e2e-tests.sh index 6a86b5bcd..223293473 100755 --- a/cicd-scripts/setup-e2e-tests.sh +++ b/cicd-scripts/setup-e2e-tests.sh @@ -88,6 +88,7 @@ approve_csr_joinrequest() { for clustername in ${clusternames}; do echo "approve joinrequest for ${clustername}" kubectl patch managedcluster ${clustername} --patch '{"spec":{"hubAcceptsClient":true}}' --type=merge + kubectl label managedcluster ${clustername} local-cluster=true if [[ -n ${IS_KIND_ENV} ]]; then # update vendor label for KinD env kubectl label managedcluster ${clustername} vendor- diff --git a/tests/pkg/utils/mco_deploy.go b/tests/pkg/utils/mco_deploy.go index 0a48233c0..5cac229b0 100644 --- a/tests/pkg/utils/mco_deploy.go +++ b/tests/pkg/utils/mco_deploy.go @@ -350,29 +350,6 @@ func CheckStatefulSetPodReady(opt TestOptions, stsName string) error { return nil } -func CheckDeploymentPodReady(opt TestOptions, deployName string) error { - client := NewKubeClient( - opt.HubCluster.ClusterServerURL, - opt.KubeConfig, - opt.HubCluster.KubeContext) - deploys := client.AppsV1().Deployments(MCO_NAMESPACE) - deploy, err := deploys.Get(context.TODO(), deployName, metav1.GetOptions{}) - if err != nil { - klog.V(1).Infof("Error while retrieving deployment %s: %s", deployName, err.Error()) - return err - } - - if deploy.Status.ReadyReplicas != *deploy.Spec.Replicas || - deploy.Status.UpdatedReplicas != *deploy.Spec.Replicas || - deploy.Status.AvailableReplicas != *deploy.Spec.Replicas { - err = fmt.Errorf("deployment %s should have %d but got %d ready replicas", - deployName, *deploy.Spec.Replicas, - deploy.Status.ReadyReplicas) - return err - } - return nil -} - // ModifyMCOCR modifies the MCO CR for reconciling. modify multiple parameter to save running time func ModifyMCOCR(opt TestOptions) error { clientDynamic := NewKubeClientDynamic(