OTA-2097, OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection - #1428
Conversation
|
@wking: This pull request references OTA-2084 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe runtime controller client now uses a dedicated scheme registering core, apiextensions/v1, and operator/v1 APIs. AgenticRun CRD availability checks handle nil clients and log lookup results. ChangesRuntime client and CRD availability
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
91ca40b to
9b64dca
Compare
…tion Adding additional logging to the logic from f29721f (OTA-2084: Conditionally deploy console plugin when AgenticRun CRD is present, 2026-07-21, openshift#1425), to make it easier to debug logs like: $ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep -i controller.go | tail -n3 I0723 23:05:41.142338 1 controller.go:184] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller" I0723 23:05:41.142835 1 controller.go:191] Failed to disable console plugin, skipping manifest cleanup: getting console operator config: no kind is registered for the type v1.Console in scheme "k8s.io/client-go/kubernetes/scheme/register.go:84" I0723 23:05:41.142922 1 controller.go:186] Finished syncing CVO configuration (586.586µs) where the cluster-version operator apparently thinks that there is no AgenticRun CRD. Despite the AgenticRun CRD having existed in that cluster for hours by the time we got those CVO logs. $ oc get customresourcedefinitions agenticruns.agentic.openshift.io NAME CREATED AT agenticruns.agentic.openshift.io 2026-07-23T19:21:46Z
9b64dca to
d8505c7
Compare
Similar to d8505c7 (pkg/start: Add apiextension to the Runtime client scheme, 2026-07-23, openshift#1428), but a different scheme. This time, we're avoiding: $ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n4 I0724 04:36:36.039365 1 controller.go:186] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller" I0724 04:36:36.100611 1 controller.go:207] Failed to enable console plugin: getting console operator config: no kind is registered for the type v1.Console in scheme "github.com/openshift/cluster-version-operator/pkg/start/start.go:536" ... out of the: enableConsolePlugin(ctx context.Context, client ctrlruntimeclient.Client) error { console := &operatorv1.Console{} if err := client.Get(ctx, types.NamespacedName{Name: "cluster"}, console); err != nil { call in pkg/agenticrun. By registering operatorv1.AddToScheme, we can successfully interact with those operator.openshift.io resources.
Avoid:
$ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n4
I0724 03:17:24.334404 1 controller.go:186] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller"
I0724 03:17:24.334427 1 controller.go:163] AgenticRun CustomResourceDefinition available? false (no kind is registered for the type v1.CustomResourceDefinition in scheme "k8s.io/client-go/kubernetes/scheme/register.go:84")
I0724 03:17:24.334445 1 controller.go:193] Failed to disable console plugin, skipping manifest cleanup: getting console operator config: no kind is registered for the type v1.Console in scheme "k8s.io/client-go/kubernetes/scheme/register.go:84"
I0724 03:17:24.334449 1 controller.go:188] Finished syncing CVO configuration (47.291µs)
out of the:
crd := &apiextensionsv1.CustomResourceDefinition{}
err := c.client.Get(context.Background(), ctrlruntimeclient.ObjectKey{Name: "agenticruns.agentic.openshift.io"}, crd)
call in pkg/agenticrun's Controller.crdAvailable, even when the CRD
itself exists in the cluster:
$ oc get customresourcedefinitions agenticruns.agentic.openshift.io
NAME CREATED AT
agenticruns.agentic.openshift.io 2026-07-24T00:40:30Z
By registering scheme.AddToScheme (all the normal stuff) and
apiextensionsv1.AddToScheme (the CRD type), we can successfully
execute that Get.
Similar to d8505c7 (pkg/start: Add apiextension to the Runtime client scheme, 2026-07-23, openshift#1428), but a different scheme. This time, we're avoiding: $ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n4 I0724 04:36:36.039365 1 controller.go:186] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller" I0724 04:36:36.100611 1 controller.go:207] Failed to enable console plugin: getting console operator config: no kind is registered for the type v1.Console in scheme "github.com/openshift/cluster-version-operator/pkg/start/start.go:536" ... out of the: enableConsolePlugin(ctx context.Context, client ctrlruntimeclient.Client) error { console := &operatorv1.Console{} if err := client.Get(ctx, types.NamespacedName{Name: "cluster"}, console); err != nil { call in pkg/agenticrun. By registering operatorv1.AddToScheme, we can successfully interact with those operator.openshift.io resources.
714357e to
2eafe1a
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retitle OTA-2097, OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection |
|
@wking: This pull request references OTA-2097 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set. This pull request references OTA-2084 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
Azure CI is having some issues, but I'm confident they're unrelated to this pull. /override ci/prow/e2e-agnostic-ovn |
|
@wking: Overrode contexts on behalf of wking: ci/prow/e2e-agnostic-ovn, ci/prow/e2e-agnostic-ovn-techpreview-serial-2of3, ci/prow/e2e-agnostic-ovn-techpreview-serial-3of3, ci/prow/e2e-agnostic-ovn-upgrade-into-change, ci/prow/e2e-agnostic-ovn-upgrade-out-of-change DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@wking: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/verified by CI and my own pre-testing |
|
@wking: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
PR openshift#1428 switched RuntimeControllerClientOrDie from the global scheme to a local scheme but missed registering agenticrunv1alpha1, breaking the agenticrun-lifecycle-controller. Add the missing AddToScheme call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adding additional logging to the logic from f29721f (#1425), to make it easier to debug logs like:
where the cluster-version operator apparently thinks that there is no AgenticRun CRD. Despite the AgenticRun CRD having existed in that cluster for hours by the time we got those CVO logs.
Summary by CodeRabbit