Skip to content

Reconciler fails to Get the new object often #3369

@dotsuber

Description

@dotsuber

Hi,
I'm using the common way to get CR file creation using event manager:

func (r *PolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
  	err := r.Get(ctx, req.NamespacedName, &policyV3)
	
  	if err == nil {
  		return r.handleV3Policy(req, &policyV3)
		} else if apierrors.IsNotFound(err) {
			r.tracer.Infof("delete event detected. removing policy %v", req.NamespacedName)
			return r.handleDeletion(req)
 	}

Usually the CR file is deleted and then a new updated one is created .

The problem is that I'm getting a NotFound error often on creation event.

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