Skip to content

Openapi operator send UpdateNotification instead of AddNotifications on operator startup #928

@etremblay

Description

@etremblay

Expected Behavior

When the operator start, all reconciled resources should be considered "new" and the onAddFilter should be applied before entering the reconcile() function.

This was the cas with the kubernetes sdk implementation but not the openapi implementation.

Actual Behaviour

The reconcile() method is never called on initial resources because we have a onUpdateFilter that check for generation changes to allow updates.

With a lot of debugging, I think I can explain the behaviour.

  • InformerWatcher call the list api and replaceObjectsAndStartWatcher()
  • ControllerResourceEventHandler::onAdd() is called on all resources but do nothing since it's disabled.
  • The operator win the leader election and the controller is enabled
  • DefaultSharedIndexInformer resync the listeners but since the objects already exists in the Indexer, the DeltaConsumer triger an UpdateNotification event instead of AddNotification.

Steps To Reproduce

Start an operator with pre-existing custom resources

Environment Information

No response

Example Application

No response

Version

4.9.2

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