Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-5246

MCE operator errors on startup when setting up webhook

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • ACM 2.8.0
    • ACM 2.8.0
    • Installer
    • None
    • False
    • None
    • False
    • Installer Sprint 23-6
    • Low
    • No

      Description of problem: At startup the MCE logs an error like the following

      2023-04-28T13:40:23Z ERROR setup Failed to get deployment {"error": "the cache is not started, can not read objects"}

      main.ensureWebhooks.func1

      /workspace/main.go:352

      This is because it tries to use the manager's client to query the Kube api before the cache has started. This will always happen because the call happens before the manager is started. It is only on subsequent calls after the manager starts that the webhook is successfully set up.

      Version-Release number of selected component (if applicable): 2.8.0

      How reproducible: Always

      Steps to Reproduce: See above description

      Actual results: Error during startup due to using controller's manager's client prematurely

      Expected results: Webhook setup should happen before the manager starts.

      Additional info:

      We should use the uncached client to configure the webhook before the manager starts and the operator condition is ready.

            jagray@redhat.com Jakob Gray
            jagray@redhat.com Jakob Gray
            Ting Xue Ting Xue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: