Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros committed Nov 12, 2024
1 parent 932df51 commit 02cf941
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
1 change: 1 addition & 0 deletions cicd-scripts/setup-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-
Expand Down
23 changes: 0 additions & 23 deletions tests/pkg/utils/mco_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 02cf941

Please sign in to comment.