diff --git a/app/daemon.go b/app/daemon.go index afd62d624f..b7d7a1be09 100644 --- a/app/daemon.go +++ b/app/daemon.go @@ -174,7 +174,10 @@ func startManager(c *cli.Context) error { } // This adds the label for the conversion webhook's selector. We do it the hard way without datastore to avoid chicken-and-egg. - pod, _ := clientsWithoutDatastore.Clients.K8s.CoreV1().Pods(podNamespace).Get(context.Background(), podName, v1.GetOptions{}) + pod, err := clientsWithoutDatastore.Clients.K8s.CoreV1().Pods(podNamespace).Get(context.Background(), podName, v1.GetOptions{}) + if err != nil { + return err + } labels := types.GetConversionWebhookLabel() for key, value := range labels { pod.Labels[key] = value diff --git a/controller/node_controller.go b/controller/node_controller.go index 54d658da4c..b5e444d080 100644 --- a/controller/node_controller.go +++ b/controller/node_controller.go @@ -523,7 +523,7 @@ func (nc *NodeController) syncNode(key string) (err error) { // have been turned off for RWX failover. labels := types.MergeStringMaps(types.GetAdmissionWebhookLabel(), types.GetRecoveryBackendLabel()) if err := nc.ds.AddLabelToManagerPod(node.Name, labels); err != nil { - log.Warnf("Node %v failed to restore its admission webhook and recovery backend", node.Name) + log.WithError(err).Error("Failed to restore its admission webhook and recovery backend") return err } diff --git a/controller/replica_controller.go b/controller/replica_controller.go index b727200cd9..83691ae62b 100644 --- a/controller/replica_controller.go +++ b/controller/replica_controller.go @@ -564,10 +564,10 @@ func (rc *ReplicaController) DeleteInstance(obj interface{}) (err error) { defer func() { if err != nil { log.WithError(err).Warnf("Failed to delete replica process %v", r.Name) - } - if isDelinquent { - log.Warnf("Ignored the failure of deleting replica process %v because the RWX volume is currently delinquent", r.Name) - err = nil + if isDelinquent { + log.Warnf("Ignored the failure of deleting replica process %v because the RWX volume is currently delinquent", r.Name) + err = nil + } } }()