Skip to content

Question: In the reconciliation of an object, is it possible to check if this object has been enqueued again? #3334

@matheuscscp

Description

@matheuscscp

Context: In Flux we have just shipped a feature to fail faster when kustomize-controller is performing health checks on the manifests it has applied to the cluster. The implementation is essentially a Goroutine fired during the Flux Kustomization reconciliation that continuously checks if the revision of the source consumed by the Flux Kustomization has changed. If it did, then we bail out earlier from the health checks to let the new enqueued reconciliation request of the object take place and apply the new source revision. We want to go beyond and let this happen for any other things we watch beyond the Flux sources. For example, we also watch ConfigMaps and Secrets that have an effect on the final manifests kustomize-controller applies to the cluster. Instead of probing all the things that are relevant for a particular Flux Kustomization object, we would like to probe the reconciliation queue instead to take advantage of the fact that our watches are already in place and will enqueue reconciliation requests. This would be the ideal solution for us.

Is there any function/method of the manager or something else that can answer queries like IsEnqueued(reconcile.Request) bool? Would the project consider accepting this contribution in case it's not already available? Or in the worst case would it be possible/simple for us on our side to build a thin wrapper around the default queue implementation to add this functionality? I saw in another issue that now controller-runtime supports injecting your own queue implementation.

@stefanprodan

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