mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
add v1 tests to hack/test-go; let default value of Container.SecurityContext to be nil
This commit is contained in:
@@ -171,6 +171,9 @@ func defaultHostNetworkPorts(containers *[]Container) {
|
||||
// defaultSecurityContext performs the downward and upward merges of a pod definition
|
||||
func defaultSecurityContext(container *Container) {
|
||||
if container.SecurityContext == nil {
|
||||
if (len(container.Capabilities.Add) == 0) && (len(container.Capabilities.Drop) == 0) && (container.Privileged == false) {
|
||||
return
|
||||
}
|
||||
glog.V(5).Infof("creating security context for container %s", container.Name)
|
||||
container.SecurityContext = &SecurityContext{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user