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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test-only][PodSecurity] Add test coverage for pod-template-containing objects #103452
[test-only][PodSecurity] Add test coverage for pod-template-containing objects #103452
Conversation
@njuptlzf: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @njuptlzf. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
cd180c1
to
4d15674
Compare
/sig auth security |
/assign @liggitt |
f95a318
to
4bcea9c
Compare
Conflict with #103445 |
4bcea9c
to
6df42ce
Compare
/hold cancel |
@@ -457,3 +465,201 @@ func TestValidateNamespace(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestValidatePodController(t *testing.T) { | |||
objMetadata := metav1.ObjectMeta{Name: "testName", Namespace: "testNS", Labels: map[string]string{"foo": "bar"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use a valid namespace (namespaces can't have upper-case characters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Name: "testName", | ||
Namespace: "testNS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set name to testns
, set namespace to ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name=testns is weird, len(namespaces)==0 cannot test namespaces are exempted,
so set
testName, testNamespace := "testname", "default"
staging/src/k8s.io/pod-security-admission/admission/admission_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/pod-security-admission/admission/admission_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/pod-security-admission/admission/admission_test.go
Outdated
Show resolved
Hide resolved
6df42ce
to
243a4b8
Compare
Wait for #103465 to merge to see if it needs to be modified... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testcases look good, needs a rebase and message update, then lgtm
/hold cancel
staging/src/k8s.io/pod-security-admission/admission/admission_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/pod-security-admission/admission/admission_test.go
Outdated
Show resolved
Hide resolved
243a4b8
to
2b88dc3
Compare
/lgtm test-only change improving test coverage of existing code, approving ahead of 7/15 test-freeze date |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, njuptlzf The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind cleanup
/kind feature
What this PR does / why we need it:
Add test coverage for pod-template-containing objects
Which issue(s) this PR fixes:
Fixes #103210
Special notes for your reviewer:
ut for
ValidatePodController
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Part of https://github.com/kubernetes/enhancements/tree/master/keps/sig-auth/2579-psp-replacement