Merge pull request #7442 from omerap12/logging-fix
Refactor logging statements
This commit is contained in:
commit
238a0c64a1
|
|
@ -110,7 +110,7 @@ func (s *AdmissionServer) admit(ctx context.Context, data []byte) (*admissionv1.
|
|||
patchType := admissionv1.PatchTypeJSONPatch
|
||||
response.PatchType = &patchType
|
||||
response.Patch = patch
|
||||
klog.V(4).Infof("Sending patches: %v", patches)
|
||||
klog.V(4).InfoS("Sending patches", "patches", patches)
|
||||
}
|
||||
|
||||
var status metrics_admission.AdmissionStatus
|
||||
|
|
|
|||
|
|
@ -88,8 +88,7 @@ var (
|
|||
func main() {
|
||||
klog.InitFlags(nil)
|
||||
kube_flag.InitFlags()
|
||||
klog.V(1).Infof("Vertical Pod Autoscaler %s Admission Controller", common.VerticalPodAutoscalerVersion)
|
||||
|
||||
klog.V(1).InfoS("Starting Vertical Pod Autoscaler Admission Controller", "version", common.VerticalPodAutoscalerVersion)
|
||||
if len(*vpaObjectNamespace) > 0 && len(*ignoredVpaObjectNamespaces) > 0 {
|
||||
klog.Fatalf("--vpa-object-namespace and --ignored-vpa-object-namespaces are mutually exclusive and can't be set together.")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ func (c *metricsClient) GetContainersMetrics() ([]*ContainerMetricsSnapshot, err
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
klog.V(3).Infof("%v podMetrics retrieved for all namespaces", len(podMetricsList.Items))
|
||||
klog.V(3).InfoS("podMetrics retrieved for all namespaces", "podMetrics", len(podMetricsList.Items))
|
||||
for _, podMetrics := range podMetricsList.Items {
|
||||
metricsSnapshotsForPod := createContainerMetricsSnapshots(podMetrics)
|
||||
metricsSnapshots = append(metricsSnapshots, metricsSnapshotsForPod...)
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ func NewVpaTargetSelectorFetcher(config *rest.Config, kubeClient kube_client.Int
|
|||
if !synced {
|
||||
klog.Fatalf("Could not sync cache for %s: %v", kind, err)
|
||||
} else {
|
||||
klog.Infof("Initial sync of %s completed", kind)
|
||||
klog.InfoS("Initial sync completed", "kind", kind)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue