mirror of https://github.com/k3s-io/k3s
Merge pull request #62176 from nikhiljindal/removeClustersForce
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Updating kubemci remove-clusters e2e test to use --force to remove from all clusters Ref https://github.com/GoogleCloudPlatform/k8s-multicluster-ingress/pull/173 Updating kubemci remove-clusters e2e test to validate that removing all clusters throws an error. It should succeed with --force=true cc @G-Harmon ```release-note NONE ```pull/8/head
commit
8282eff12f
|
@ -673,10 +673,15 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
|
|||
name := jig.Ingress.Name
|
||||
// Verify that the ingress is spread to 1 cluster as expected.
|
||||
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.
|
||||
filePath := filepath.Join(framework.TestContext.OutputDir, "mci.yaml")
|
||||
if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath); err != nil {
|
||||
framework.Failf("unexpected error in running kubemci remove-clusters: %s", err)
|
||||
if _, err := framework.RunKubemciWithKubeconfig("remove-clusters", name, "--ingress="+filePath); err == nil {
|
||||
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")
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue