Commit c4fcb1e8 authored by nikhiljindal's avatar nikhiljindal

Updating kubemci remove-clusters e2e test to use --force to remove from all clusters

parent 9f4b851e
...@@ -640,10 +640,15 @@ var _ = SIGDescribe("Loadbalancing: L7", func() { ...@@ -640,10 +640,15 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
name := jig.Ingress.Name name := jig.Ingress.Name
// Verify that the ingress is spread to 1 cluster as expected. // Verify that the ingress is spread to 1 cluster as expected.
verifyKubemciStatusHas(name, "is spread across 1 cluster") verifyKubemciStatusHas(name, "is spread across 1 cluster")
// Validate that removing the ingress from all clusters throws an error.
// Reuse the ingress file created while creating the ingress. // Reuse the ingress file created while creating the ingress.
filePath := filepath.Join(framework.TestContext.OutputDir, "mci.yaml") filePath := filepath.Join(framework.TestContext.OutputDir, "mci.yaml")
if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath); err != nil { if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath); err == nil {
framework.Failf("unexpected error in running kubemci remove-clusters: %s", err) framework.Failf("expected non-nil error in running kubemci remove-clusters to remove from all clusters")
}
// remove-clusters should succeed with --force=true
if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath, "--force=true"); err != nil {
framework.Failf("unexpected error in running kubemci remove-clusters to remove from all clusters with --force=true: %s", err)
} }
verifyKubemciStatusHas(name, "is spread across 0 cluster") verifyKubemciStatusHas(name, "is spread across 0 cluster")
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment