This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add '--force' flag when switching from 'Ignore' to 'Propagate' mode
If the user switch the propagation mode directly from 'Ignore' to 'Propagate', it will fail with an error message telling the user that a '--force' flag is needed. '-f' is also supported as a shorthand. Tested: make test-e2e
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package e2e | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "sigs.k8s.io/multi-tenancy/incubator/hnc/pkg/testutils" | ||
) | ||
|
||
var _ = Describe("HNS set-config", func() { | ||
It("Should use '--force' flag to change from 'Ignore' to 'Propagate'", func() { | ||
MustRun("kubectl hns config set-type --apiVersion v1 --kind Secret Ignore") | ||
MustNotRun("kubectl hns config set-type --apiVersion v1 --kind Secret Propagate") | ||
MustRun("kubectl hns config set-type --apiVersion v1 --kind Secret Propagate --force") | ||
// check that we don't need '--force' flag when changing it back | ||
MustRun("kubectl hns config set-type --apiVersion v1 --kind Secret Ignore") | ||
}) | ||
}) |