Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 cleanup e2e tests for go/v4 #3958

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/e2e/utils/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,21 @@ func (t *TestContext) CreateManagerNamespace() error {
return err
}

// LabelAllNamespacesToWarnAboutRestricted will label all namespaces so that we can verify
// LabelNamespacesToWarnAboutRestricted will label all namespaces so that we can verify
// if a warning with `Warning: would violate PodSecurity` will be raised when the manifests are applied
func (t *TestContext) LabelAllNamespacesToWarnAboutRestricted() error {
_, err := t.Kubectl.Command("label", "--overwrite", "ns", "--all",
func (t *TestContext) LabelNamespacesToWarnAboutRestricted() error {
_, err := t.Kubectl.Command("label", "--overwrite", "ns", t.Kubectl.Namespace,
"pod-security.kubernetes.io/warn=restricted")
return err
}

// RemoveNamespaceLabelToWarnAboutRestricted will remove the `pod-security.kubernetes.io/warn` label
// from the specified namespace
func (t *TestContext) RemoveNamespaceLabelToWarnAboutRestricted() error {
_, err := t.Kubectl.Command("label", "ns", t.Kubectl.Namespace, "pod-security.kubernetes.io/warn-")
return err
}

// LoadImageToKindCluster loads a local docker image to the kind cluster
func (t *TestContext) LoadImageToKindCluster() error {
cluster := "kind"
Expand Down
Loading
Loading