Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-4489

GitOps operator depends on deprecated API or removed API

XMLWordPrintable

    • 5
    • False
    • None
    • False
    • GitOps Scarlet - Sprint 3256

      Description of problem:

      On a cluster with the DeploymentConfig capability disabled ( see  https://docs.openshift.com/container-platform/4.14/installing/cluster-capabilities.html#deployment-config-capability_cluster-capabilities ) the OpenShift GitOps controller-manager pod loops in crashloop backoff with the following error message:

      2024-04-10T15:40:24Z ERROR controller-runtime.source.EventHandler if kind is a CRD, it should be installed before calling Start {"kind": "DeploymentConfig.apps.openshift.io", "error": "no matches for kind \"DeploymentConfig\" in version \"apps.openshift.io/v1\""} sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1 /remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/source/kind.go:63 k8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func1 /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.28.3/pkg/util/wait/loop.go:49 k8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.28.3/pkg/util/wait/loop.go:50 k8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.28.3/pkg/util/wait/poll.go:33 sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1 /remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/source/kind.go:56 2024-04-10T15:40:24Z ERROR controller-runtime.source.EventHandler if kind is a CRD, it should be installed before calling Start {"kind": "DeploymentConfig.apps.openshift.io", "error": "no matches for kind \"DeploymentConfig\" in version \"apps.openshift.io/v1\""} sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1 /remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/source/kind.go:63 k8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func2 /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.28.3/pkg/util/wait/loop.go:73 k8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.28.3/pkg/util/wait/loop.go:74 k8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.28.3/pkg/util/wait/poll.go:33 sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1 /remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/source/kind.go:56 [...] 2024-04-10T15:42:24Z ERROR setup problem running manager {"error": "failed to wait for argocd caches to sync: timed out waiting for cache to be synced for Kind *v1.DeploymentConfig"}

      The relevant code is here:
      https://github.com/argoproj-labs/argocd-operator/blob/c7c457dea032941b3c13d86db5e8045d62d8c6a3/controllers/argocd/util.go#L1081

       

      Before watching for an API ressource changes we should check before if this API is available in the cluster.
      However In the code above we check for the Template API and based on that check, we watch for DeploymentConfigs. I might be missing something but that coupling seems wrong.

      Reproducibility (Always/Intermittent/Only Once): Always

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

            cbanavik Chetan Banavikalmutt
            rhn-support-ekasprzy Emmanuel Kasprzyk
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: