Skip to content

Commit 6289b62

Browse files
committed
Return errors, remove unused return value
1 parent bcec29d commit 6289b62

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

internal/controller/onboarding_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (r *OnboardingController) completeOnboarding(ctx context.Context, host stri
211211
_, err = setNodeLabels(ctx, r, node, map[string]string{
212212
labelOnboardingState: onboardingValueCompleted,
213213
})
214-
return ctrl.Result{}, nil
214+
return ctrl.Result{}, err
215215
}
216216

217217
func (r *OnboardingController) ensureNovaLabels(ctx context.Context, node *corev1.Node) (ctrl.Result, bool, error) {

internal/controller/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ func hasAnyLabel(labels map[string]string, list ...string) bool {
7373
}
7474

7575
// setNodeAnnotations sets annotations on the node.
76-
func setNodeAnnotations(ctx context.Context, writer client.Writer, node *corev1.Node, annotations map[string]string) (bool, error) {
76+
func setNodeAnnotations(ctx context.Context, writer client.Writer, node *corev1.Node, annotations map[string]string) error {
7777
newNode := node.DeepCopy()
7878
maps.Copy(newNode.Annotations, annotations)
7979
if maps.Equal(node.Annotations, newNode.Annotations) {
80-
return false, nil
80+
return nil
8181
}
8282

83-
return true, writer.Patch(ctx, newNode, client.MergeFrom(node))
83+
return writer.Patch(ctx, newNode, client.MergeFrom(node))
8484
}

0 commit comments

Comments
 (0)