Skip to content

Commit

Permalink
rework managed service validation
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Bortnikov <[email protected]>
  • Loading branch information
BROngineer committed Jan 20, 2025
1 parent 9a8bfd0 commit 10e370c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/e2e/clusterdeployment/servicevalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (v *ServiceValidator) Validate(ctx context.Context, kc *kubeclient.KubeClie
clusterKubeClient := kc.NewFromCluster(ctx, v.namespace, v.clusterDeploymentName)

for resourceName, resource := range v.resourcesToValidate {
resourceFullName := resource.resourceFullName(v.managedServiceName)
resourceFullName := fmt.Sprintf("%s-%s", resource.resourceFullName(v.managedServiceName), "controller")
err := resource.ValidationFunc(ctx, clusterKubeClient, resourceFullName)
if err != nil {
_, _ = fmt.Fprintf(GinkgoWriter, "[%s/%s] validation error: %v\n", v.template, resourceName, err)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/kubeclient/kubeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (kc *KubeClient) CreateMultiClusterService(
Group: "k0rdent.mirantis.com",
Version: "v1alpha1",
Resource: "multiclusterservices",
}, true)
}, false)

_, err := client.Create(ctx, multiClusterService, metav1.CreateOptions{})
if !apierrors.IsAlreadyExists(err) {
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/multi_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ var _ = Context("Multi Cloud Templates", Label("provider:cloud", "provider:aws-a
})

By("validating service is deployed", func() {
awsServiceDeployedValidator := clusterdeployment.NewServiceValidator(awsClusterDeploymentName, "default", "managed-ingress-nginx").
awsServiceDeployedValidator := clusterdeployment.NewServiceValidator(awsClusterDeploymentName, "managed-ingress-nginx", "default").
WithResourceValidation("service", clusterdeployment.ManagedServiceResource{
ResourceNameSuffix: "",
ValidationFunc: clusterdeployment.ValidateService,
Expand All @@ -196,9 +196,9 @@ var _ = Context("Multi Cloud Templates", Label("provider:cloud", "provider:aws-a
})
Eventually(func() error {
return awsServiceDeployedValidator.Validate(context.Background(), kc)
}).WithTimeout(30 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())
}).WithTimeout(10 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())

azureServiceDeployedValidator := clusterdeployment.NewServiceValidator(azureClusterDeploymentName, "default", "managed-ingress-nginx").
azureServiceDeployedValidator := clusterdeployment.NewServiceValidator(azureClusterDeploymentName, "managed-ingress-nginx", "default").
WithResourceValidation("service", clusterdeployment.ManagedServiceResource{
ResourceNameSuffix: "",
ValidationFunc: clusterdeployment.ValidateService,
Expand All @@ -209,7 +209,7 @@ var _ = Context("Multi Cloud Templates", Label("provider:cloud", "provider:aws-a
})
Eventually(func() error {
return azureServiceDeployedValidator.Validate(context.Background(), kc)
}).WithTimeout(30 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())
}).WithTimeout(10 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())
})
})
})
2 changes: 1 addition & 1 deletion test/e2e/provider_aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var _ = Describe("AWS Templates", Label("provider:cloud", "provider:aws"), Order
})
Eventually(func() error {
return serviceDeployedValidator.Validate(context.Background(), kc)
}).WithTimeout(30 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())
}).WithTimeout(10 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())

templateBy(clusterdeployment.TemplateAWSHostedCP, "installing controller and templates on standalone cluster")

Expand Down

0 comments on commit 10e370c

Please sign in to comment.