Manager does not detect Route CRD that appears after startup

オープン
#1,566 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@atishay-kasliwal がすでに取り組んでいます。

2026年11月19日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, kubernetes
領域
backend, devops

調査の方向性

Start with cmd/main.go and trace how util.IsRouteAPIFound() controls routev1.AddToScheme; then read the startup call to InspectCluster. The report says both checks happen only once, so investigate where API discovery or CRD events could update the scheme after startup. Done means a Route CRD created after manager startup can be reconciled without restarting the manager.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

On a GKE management cluster where HyperShift is installed through GitOps, the OpenShift GitOps manager starts before the routes.route.openshift.io CRD exists. The manager registers the Route type only at startup: cmd/main.go calls routev1.AddToScheme only when util.IsRouteAPIFound() is true, and InspectCluster runs once. A Route API that appears later is never added to the scheme, so every Route reconciliation fails with:

no kind is registered for the type v1.Route in scheme "pkg/runtime/scheme.go:111"

The ArgoCD instance stays phase=Failed with Reconciled=False until the manager pod is restarted with the Route API present. This is not an edge case for this deployment shape: because the cluster installs HyperShift through Argo CD, the manager always starts before HyperShift creates the Route CRD.

To Reproduce

  1. Create a GKE cluster and install the OpenShift GitOps 1.22.2 operator, so the manager starts while route.openshift.io is absent.
  2. Confirm the API group is absent:
kubectl --context "$CTX" api-resources --api-group=route.openshift.io

Expected: no resources listed.

  1. Install HyperShift through Argo CD. The sync creates routes.route.openshift.io roughly 47 minutes after the manager started.
  2. Wait for the operator to reconcile the ArgoCD instance.

Actual results

ArgoCD reports phase: Failed, Reconciled: False with the scheme error above. The operator log repeats the same error on each Route reconcile and it persists indefinitely.

Expected behavior

The manager should handle a Route CRD that appears after startup. Two approaches that would satisfy the use case:

  • re-run API discovery periodically or on CRD watch events and add the Route type to the scheme once routes.route.openshift.io is available, or
  • watch for the CRD itself instead of doing a one-time check at startup.

No claim is made about which approach upstream prefers.

Environment

  • OpenShift GitOps 1.22.2, release 7 (openshift-gitops-operator.v1.22.2)
  • Advisory RHBA-2026:83602 (2026-10-15)
  • Bundle registry.redhat.io/openshift-gitops-1/gitops-operator-bundle@sha256:2ba58c50f771c08bbc5a1d8572c7b058df55bc71667cc66026d42840eb4bee6d
  • Operator source redhat-developer/gitops-operator at cf32771491be2ed7f03d43d279171d6c265f2d2b
  • Downstream source rh-gitops-midstream/release at 219dafaaf0e9431f8b468b4932f337f3ce397058
  • GKE 1.36.4-gke.2377000 on Autopilot, REGULAR channel
  • Config Sync 1.23.3, Argo CD installed by Config Sync from a public bootstrap repo

Additional context

Timeline observed on 2026-11-13 (UTC):

  • 16:00:03: manager pod started in gitops-operator.
  • 16:46:57: HyperShift CRDs landed on the management cluster API server after the root ApplicationSet synced the management-cluster applications.
  • 16:47:00: routes.route.openshift.io created.
  • 16:47:11 to 17:08: ArgoCD reported phase=Failed, Reconciled=False; the scheme error repeated on every Route reconcile.
  • 17:08: manager pod deleted manually. The replacement registered the Route scheme and the instance reached phase=Available, Reconciled=True. No Route object was created because every route switch in the instance spec is disabled.

Source reference at the released commit cf327714:

  • cmd/main.go calls routev1.AddToScheme only when util.IsRouteAPIFound() returns true.
  • InspectCluster runs once at startup.

GITOPS-11466 (PR #1321, release backport #1354, commit 139db716ae65182624429cc1d78cd5a1c625f15c) makes Route detection independent of the Config API. That fixes a manager that starts after the Route CRD exists but with the Config API absent. It does not cover a Route API that appears after startup.

Workaround, either variant restores the manager without a code change:

  1. Install the Route CRD before the GitOps manager starts.
  2. Restart the manager once routes.route.openshift.io exists:
kubectl --context "$CTX" get crd routes.route.openshift.io
kubectl --context "$CTX" -n "$OPERATOR_NS" rollout restart deployment/openshift-gitops-operator-controller-manager
kubectl --context "$CTX" -n "$OPERATOR_NS" rollout status deployment/openshift-gitops-operator-controller-manager

This was found during a bounded development validation on a disposable GKE cluster. It is not a support or certification statement about this configuration.

主要言語
Go
スター
190
フォーク
367
平均マージ
4日 2時間
マージ済み PR(30日)
63

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

redhat-developer/gitops-operator のほかの issue

redhat-developer/gitops-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。