Skip to content

fix superfluous retry.RetryOnConflict in decomission_controller #108

@notandy

Description

@notandy

example code to be tested for decomission_controller.go:86

		return ctrl.Result{}, k8sclient.IgnoreNotFound(retry.RetryOnConflict(retry.DefaultRetry, func() error {
			node := &corev1.Node{}
			if err := r.Get(ctx, req.NamespacedName, node); err != nil {
				return err
			}
			nodeBase := node.DeepCopy()
			if controllerutil.AddFinalizer(node, decommissionFinalizerName) {
				return r.Patch(ctx, node, k8sclient.MergeFromWithOptions(
					nodeBase, k8sclient.MergeFromWithOptimisticLock{}))
			}
			return nil
		}))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions