Skip to content

When status update fails on CR, all following enqueued namespaceconfigs are not processed #132

@fherbert

Description

@fherbert

We have 5 namespaceconfigs. We find that sometimes it takes a long time for all the namespace configurations to be applied to the namespace. We've found a correlation between when the controller fails to update the CR status of the namespaceconfig, any pending namespaceconfig reconciles are not processed until next time a reconcile is triggered.
An example log of the CR status not being able to update is below

2022-10-26T21:54:53.240Z    ERROR    enforcing-reconciler    unable to update status for    {"object": {"kind":"NamespaceConfig","apiVersion":"redhatcop.redhat.io/v1alpha1","metadata":{"name":"default-resourcequota",}}, "error": "Operation cannot be fulfilled on namespaceconfigs.redhatcop.redhat.io \"default-resourcequota\": the object has been modified; please apply your changes to the latest version and try again"}
github.com/redhat-cop/namespace-configuration-operator/controllers.(*NamespaceConfigReconciler).Reconcile
    /home/runner/work/namespace-configuration-operator/namespace-configuration-operator/controllers/namespaceconfig_controller.go:127
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
    /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:298
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
    /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
    /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214
2022-10-26T21:54:53.240Z    ERROR    controller-runtime.manager.controller.namespaceconfig    Reconciler error    {"reconciler group": "redhatcop.redhat.io", "reconciler kind": "NamespaceConfig", "name": "default-resourcequota", "namespace": "", "error": "Operation cannot be fulfilled on namespaceconfigs.redhatcop.redhat.io \"default-resourcequota\": the object has been modified; please apply your changes to the latest version and try again"}

Any other namespace configs after default-limitrange are not processed during this reconcile event.

I'm not sure if replacing the ManageSuccess function with ManageSuccessWithRequeue in the namespaceconfig Reconcile function would fix this or not?

It would seem like a bug not to keep processing the rest of the namespaceconfigs when one of them fail to update CR status?

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