From 674aefbd8fbfb1308739839adebc30ccb35bb579 Mon Sep 17 00:00:00 2001 From: pigletfly Date: Mon, 20 Dec 2021 11:32:01 +0800 Subject: [PATCH] Fix log error when extract container from fieldpath failed Signed-off-by: pigletfly --- pkg/control/sidecarcontrol/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/control/sidecarcontrol/util.go b/pkg/control/sidecarcontrol/util.go index c3ff750deb..f5910d1f0c 100644 --- a/pkg/control/sidecarcontrol/util.go +++ b/pkg/control/sidecarcontrol/util.go @@ -286,7 +286,7 @@ func GetSidecarTransferEnvs(sidecarContainer *appsv1alpha1.SidecarContainer, pod if tEnv.SourceContainerNameFrom != nil && tEnv.SourceContainerNameFrom.FieldRef != nil { containerName, err := ExtractContainerNameFromFieldPath(tEnv.SourceContainerNameFrom.FieldRef, pod) if err != nil { - klog.Errorf("unmarshal pod(%s.%s) annotations[%s] failed: %s", pod.Namespace, pod.Name, err.Error()) + klog.Errorf("get containerName from pod(%s.%s) annotations or labels[%s] failed: %s", pod.Namespace, pod.Name, tEnv.SourceContainerNameFrom.FieldRef, err.Error()) continue } sourceContainerName = containerName