mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
security_context_test.go(TestVerifyRunAsNonRoot): remove unused variables.
This commit is contained in:
parent
2aeace402a
commit
0512f2b448
@ -47,18 +47,14 @@ func TestVerifyRunAsNonRoot(t *testing.T) {
|
|||||||
rootUser := int64(0)
|
rootUser := int64(0)
|
||||||
runAsNonRootTrue := true
|
runAsNonRootTrue := true
|
||||||
runAsNonRootFalse := false
|
runAsNonRootFalse := false
|
||||||
imageRootUser := int64(0)
|
|
||||||
imageNonRootUser := int64(123)
|
|
||||||
for _, test := range []struct {
|
for _, test := range []struct {
|
||||||
desc string
|
desc string
|
||||||
sc *v1.SecurityContext
|
sc *v1.SecurityContext
|
||||||
imageUser int64
|
|
||||||
fail bool
|
fail bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
desc: "Pass if SecurityContext is not set",
|
desc: "Pass if SecurityContext is not set",
|
||||||
sc: nil,
|
sc: nil,
|
||||||
imageUser: imageRootUser,
|
|
||||||
fail: false,
|
fail: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -66,7 +62,6 @@ func TestVerifyRunAsNonRoot(t *testing.T) {
|
|||||||
sc: &v1.SecurityContext{
|
sc: &v1.SecurityContext{
|
||||||
RunAsUser: &rootUser,
|
RunAsUser: &rootUser,
|
||||||
},
|
},
|
||||||
imageUser: imageRootUser,
|
|
||||||
fail: false,
|
fail: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -74,7 +69,6 @@ func TestVerifyRunAsNonRoot(t *testing.T) {
|
|||||||
sc: &v1.SecurityContext{
|
sc: &v1.SecurityContext{
|
||||||
RunAsNonRoot: &runAsNonRootFalse,
|
RunAsNonRoot: &runAsNonRootFalse,
|
||||||
},
|
},
|
||||||
imageUser: imageRootUser,
|
|
||||||
fail: false,
|
fail: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -83,7 +77,6 @@ func TestVerifyRunAsNonRoot(t *testing.T) {
|
|||||||
RunAsNonRoot: &runAsNonRootFalse,
|
RunAsNonRoot: &runAsNonRootFalse,
|
||||||
RunAsUser: &rootUser,
|
RunAsUser: &rootUser,
|
||||||
},
|
},
|
||||||
imageUser: imageNonRootUser,
|
|
||||||
fail: false,
|
fail: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -92,7 +85,6 @@ func TestVerifyRunAsNonRoot(t *testing.T) {
|
|||||||
RunAsNonRoot: &runAsNonRootTrue,
|
RunAsNonRoot: &runAsNonRootTrue,
|
||||||
RunAsUser: &rootUser,
|
RunAsUser: &rootUser,
|
||||||
},
|
},
|
||||||
imageUser: imageNonRootUser,
|
|
||||||
fail: true,
|
fail: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -100,7 +92,6 @@ func TestVerifyRunAsNonRoot(t *testing.T) {
|
|||||||
sc: &v1.SecurityContext{
|
sc: &v1.SecurityContext{
|
||||||
RunAsNonRoot: &runAsNonRootTrue,
|
RunAsNonRoot: &runAsNonRootTrue,
|
||||||
},
|
},
|
||||||
imageUser: imageRootUser,
|
|
||||||
fail: true,
|
fail: true,
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
|
Loading…
Reference in New Issue
Block a user