Skip to content

Commit

Permalink
Fix log error when extract container from fieldpath failed
Browse files Browse the repository at this point in the history
Signed-off-by: pigletfly <wangbing.adam@gmail.com>
  • Loading branch information
pigletfly committed Dec 20, 2021
1 parent 308d40b commit 674aefb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/control/sidecarcontrol/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 674aefb

Please sign in to comment.