@@ -1055,7 +1055,7 @@ func updateSelfWithVersionInfo(ctx context.Context, eventLog record.EventRecorde
10551055
10561056 // Copy pod and update the labels.
10571057 newPod := pod .DeepCopy ()
1058- labels := newPod .ObjectMeta . Labels
1058+ labels := newPod .Labels
10591059 if labels == nil {
10601060 labels = make (map [string ]string )
10611061 }
@@ -1068,7 +1068,7 @@ func updateSelfWithVersionInfo(ctx context.Context, eventLog record.EventRecorde
10681068 if agentVersion != "" {
10691069 labels [agentVersionLabel ] = agentVersion
10701070 }
1071- newPod .ObjectMeta . Labels = labels
1071+ newPod .Labels = labels
10721072
10731073 _ , err = kubeClient .CoreV1 ().Pods (newPod .ObjectMeta .Namespace ).Update (context .TODO (), newPod , meta_v1.UpdateOptions {})
10741074 if err != nil {
@@ -1081,7 +1081,7 @@ func updateSelfWithVersionInfo(ctx context.Context, eventLog record.EventRecorde
10811081 fmt .Fprintf (labelsString , "%s=\" %s\" , " , key , value )
10821082 }
10831083 eventLog .Eventf (newPod , api_v1 .EventTypeNormal , nl .EventReasonUpdatePodLabel , "Successfully added version labels, %s" , strings .TrimRight (labelsString .String (), ", " ))
1084- nl .Infof (l , "Pod label updated: %s" , pod .ObjectMeta . Name )
1084+ nl .Infof (l , "Pod label updated: %s" , pod .Name )
10851085 podUpdated = true
10861086 }
10871087
@@ -1092,7 +1092,7 @@ func updateSelfWithVersionInfo(ctx context.Context, eventLog record.EventRecorde
10921092
10931093func createAndValidateHeadlessService (ctx context.Context , kubeClient kubernetes.Interface , cfgParams * configs.ConfigParams , controllerNamespace string , pod * api_v1.Pod ) error {
10941094 l := nl .LoggerFromContext (ctx )
1095- owner := pod .ObjectMeta . OwnerReferences [0 ]
1095+ owner := pod .OwnerReferences [0 ]
10961096 name := owner .Name
10971097 if strings .ToLower (owner .Kind ) == "replicaset" {
10981098 if dash := strings .LastIndex (name , "-" ); dash != - 1 {
@@ -1201,12 +1201,12 @@ func initLogger(logFormat string, level slog.Level, out io.Writer) context.Conte
12011201 },
12021202 }
12031203
1204- switch {
1205- case logFormat == "glog" :
1204+ switch logFormat {
1205+ case "glog" :
12061206 h = nic_glog .New (out , & nic_glog.Options {Level : programLevel })
1207- case logFormat == "json" :
1207+ case "json" :
12081208 h = slog .NewJSONHandler (out , opts )
1209- case logFormat == "text" :
1209+ case "text" :
12101210 h = slog .NewTextHandler (out , opts )
12111211 default :
12121212 h = nic_glog .New (out , & nic_glog.Options {Level : programLevel })
0 commit comments