add non-root directive to SC and kubelet checking
This commit is contained in:
@@ -1803,6 +1803,7 @@ func deepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *c
|
||||
} else {
|
||||
out.RunAsUser = nil
|
||||
}
|
||||
out.RunAsNonRoot = in.RunAsNonRoot
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -2166,6 +2166,11 @@ type SecurityContext struct {
|
||||
|
||||
// RunAsUser is the UID to run the entrypoint of the container process.
|
||||
RunAsUser *int64 `json:"runAsUser,omitempty"`
|
||||
|
||||
// RunAsNonRoot indicates that the container should be run as a non-root user. If the RunAsUser
|
||||
// field is not explicitly set then the kubelet may check the image for a specified user or
|
||||
// perform defaulting to specify a user.
|
||||
RunAsNonRoot bool
|
||||
}
|
||||
|
||||
// SELinuxOptions are the labels to be applied to the container.
|
||||
|
@@ -2002,6 +2002,7 @@ func convert_api_SecurityContext_To_v1_SecurityContext(in *api.SecurityContext,
|
||||
} else {
|
||||
out.RunAsUser = nil
|
||||
}
|
||||
out.RunAsNonRoot = in.RunAsNonRoot
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4344,6 +4345,7 @@ func convert_v1_SecurityContext_To_api_SecurityContext(in *SecurityContext, out
|
||||
} else {
|
||||
out.RunAsUser = nil
|
||||
}
|
||||
out.RunAsNonRoot = in.RunAsNonRoot
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -1812,6 +1812,7 @@ func deepCopy_v1_SecurityContext(in SecurityContext, out *SecurityContext, c *co
|
||||
} else {
|
||||
out.RunAsUser = nil
|
||||
}
|
||||
out.RunAsNonRoot = in.RunAsNonRoot
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -2030,6 +2030,11 @@ type SecurityContext struct {
|
||||
|
||||
// RunAsUser is the UID to run the entrypoint of the container process.
|
||||
RunAsUser *int64 `json:"runAsUser,omitempty" description:"the user id that runs the first process in the container; see http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context"`
|
||||
|
||||
// RunAsNonRoot indicates that the container should be run as a non-root user. If the RunAsUser
|
||||
// field is not explicitly set then the kubelet may check the image for a specified user or
|
||||
// perform defaulting to specify a user.
|
||||
RunAsNonRoot bool `json:"runAsNonRoot,omitempty" description:"indicates the container must be run as a non-root user either by specifying the runAsUser or in the image specification"`
|
||||
}
|
||||
|
||||
// SELinuxOptions are the labels to be applied to the container
|
||||
|
Reference in New Issue
Block a user