Skip to content

Commit

Permalink
Fix Derek's review comments
Browse files Browse the repository at this point in the history
longhorn-6205

Signed-off-by: Phan Le <phan.le@suse.com>
  • Loading branch information
PhanLe1010 committed Jul 23, 2024
1 parent d1422f2 commit cd8220c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion controller/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 4 additions & 4 deletions controller/replica_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}()

Expand Down

0 comments on commit cd8220c

Please sign in to comment.