From ae981b73a38f4ee2c20d29ca98f76b114c4b499c Mon Sep 17 00:00:00 2001 From: Paul Weil Date: Wed, 27 May 2015 19:12:04 -0400 Subject: [PATCH] reduce merge logging --- pkg/api/v1beta1/defaults.go | 7 +------ pkg/api/v1beta2/defaults.go | 7 +------ pkg/api/v1beta3/defaults.go | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/pkg/api/v1beta1/defaults.go b/pkg/api/v1beta1/defaults.go index e8405597a99..0b2ea9d2253 100644 --- a/pkg/api/v1beta1/defaults.go +++ b/pkg/api/v1beta1/defaults.go @@ -208,12 +208,11 @@ func defaultHostNetworkPorts(containers *[]Container) { // defaultSecurityContext performs the downward and upward merges of a pod definition func defaultSecurityContext(container *Container) { if container.SecurityContext == nil { - glog.V(4).Infof("creating security context for container %s", container.Name) + glog.V(5).Infof("creating security context for container %s", container.Name) container.SecurityContext = &SecurityContext{} } // if there are no capabilities defined on the SecurityContext then copy the container settings if container.SecurityContext.Capabilities == nil { - glog.V(4).Infof("downward merge of container.Capabilities for container %s", container.Name) container.SecurityContext.Capabilities = &container.Capabilities } else { // if there are capabilities defined on the security context and the container setting is @@ -222,17 +221,14 @@ func defaultSecurityContext(container *Container) { // there are settings in both then don't touch it, the converter will error if they don't // match if len(container.Capabilities.Add) == 0 { - glog.V(4).Infof("upward merge of container.Capabilities.Add for container %s", container.Name) container.Capabilities.Add = container.SecurityContext.Capabilities.Add } if len(container.Capabilities.Drop) == 0 { - glog.V(4).Infof("upward merge of container.Capabilities.Drop for container %s", container.Name) container.Capabilities.Drop = container.SecurityContext.Capabilities.Drop } } // if there are no privileged settings on the security context then copy the container settings if container.SecurityContext.Privileged == nil { - glog.V(4).Infof("downward merge of container.Privileged for container %s", container.Name) container.SecurityContext.Privileged = &container.Privileged } else { // we don't have a good way to know if container.Privileged was set or just defaulted to false @@ -240,7 +236,6 @@ func defaultSecurityContext(container *Container) { // container is set to false and assume that the Privileged field was left off the container // definition and not an intentional mismatch if *container.SecurityContext.Privileged && !container.Privileged { - glog.V(4).Infof("upward merge of container.Privileged for container %s", container.Name) container.Privileged = *container.SecurityContext.Privileged } } diff --git a/pkg/api/v1beta2/defaults.go b/pkg/api/v1beta2/defaults.go index d0e7bffc661..461eb05b09e 100644 --- a/pkg/api/v1beta2/defaults.go +++ b/pkg/api/v1beta2/defaults.go @@ -209,12 +209,11 @@ func defaultHostNetworkPorts(containers *[]Container) { // defaultSecurityContext performs the downward and upward merges of a pod definition func defaultSecurityContext(container *Container) { if container.SecurityContext == nil { - glog.V(4).Infof("creating security context for container %s", container.Name) + glog.V(5).Infof("creating security context for container %s", container.Name) container.SecurityContext = &SecurityContext{} } // if there are no capabilities defined on the SecurityContext then copy the container settings if container.SecurityContext.Capabilities == nil { - glog.V(4).Infof("downward merge of container.Capabilities for container %s", container.Name) container.SecurityContext.Capabilities = &container.Capabilities } else { // if there are capabilities defined on the security context and the container setting is @@ -223,17 +222,14 @@ func defaultSecurityContext(container *Container) { // there are settings in both then don't touch it, the converter will error if they don't // match if len(container.Capabilities.Add) == 0 { - glog.V(4).Infof("upward merge of container.Capabilities.Add for container %s", container.Name) container.Capabilities.Add = container.SecurityContext.Capabilities.Add } if len(container.Capabilities.Drop) == 0 { - glog.V(4).Infof("upward merge of container.Capabilities.Drop for container %s", container.Name) container.Capabilities.Drop = container.SecurityContext.Capabilities.Drop } } // if there are no privileged settings on the security context then copy the container settings if container.SecurityContext.Privileged == nil { - glog.V(4).Infof("downward merge of container.Privileged for container %s", container.Name) container.SecurityContext.Privileged = &container.Privileged } else { // we don't have a good way to know if container.Privileged was set or just defaulted to false @@ -241,7 +237,6 @@ func defaultSecurityContext(container *Container) { // container is set to false and assume that the Privileged field was left off the container // definition and not an intentional mismatch if *container.SecurityContext.Privileged && !container.Privileged { - glog.V(4).Infof("upward merge of container.Privileged for container %s", container.Name) container.Privileged = *container.SecurityContext.Privileged } } diff --git a/pkg/api/v1beta3/defaults.go b/pkg/api/v1beta3/defaults.go index f387a45f946..d542e5f3047 100644 --- a/pkg/api/v1beta3/defaults.go +++ b/pkg/api/v1beta3/defaults.go @@ -171,12 +171,11 @@ func defaultHostNetworkPorts(containers *[]Container) { // defaultSecurityContext performs the downward and upward merges of a pod definition func defaultSecurityContext(container *Container) { if container.SecurityContext == nil { - glog.V(4).Infof("creating security context for container %s", container.Name) + glog.V(5).Infof("creating security context for container %s", container.Name) container.SecurityContext = &SecurityContext{} } // if there are no capabilities defined on the SecurityContext then copy the container settings if container.SecurityContext.Capabilities == nil { - glog.V(4).Infof("downward merge of container.Capabilities for container %s", container.Name) container.SecurityContext.Capabilities = &container.Capabilities } else { // if there are capabilities defined on the security context and the container setting is @@ -185,17 +184,14 @@ func defaultSecurityContext(container *Container) { // there are settings in both then don't touch it, the converter will error if they don't // match if len(container.Capabilities.Add) == 0 { - glog.V(4).Infof("upward merge of container.Capabilities.Add for container %s", container.Name) container.Capabilities.Add = container.SecurityContext.Capabilities.Add } if len(container.Capabilities.Drop) == 0 { - glog.V(4).Infof("upward merge of container.Capabilities.Drop for container %s", container.Name) container.Capabilities.Drop = container.SecurityContext.Capabilities.Drop } } // if there are no privileged settings on the security context then copy the container settings if container.SecurityContext.Privileged == nil { - glog.V(4).Infof("downward merge of container.Privileged for container %s", container.Name) container.SecurityContext.Privileged = &container.Privileged } else { // we don't have a good way to know if container.Privileged was set or just defaulted to false @@ -203,7 +199,6 @@ func defaultSecurityContext(container *Container) { // container is set to false and assume that the Privileged field was left off the container // definition and not an intentional mismatch if *container.SecurityContext.Privileged && !container.Privileged { - glog.V(4).Infof("upward merge of container.Privileged for container %s", container.Name) container.Privileged = *container.SecurityContext.Privileged } }