Skip to content

OTA-2097, OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection - #1428

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift:mainfrom
wking:agentic-run-crd-detection-transparency
Jul 24, 2026
Merged

OTA-2097, OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection#1428
openshift-merge-bot[bot] merged 3 commits into
openshift:mainfrom
wking:agentic-run-crd-detection-transparency

Conversation

@wking

@wking wking commented Jul 23, 2026

Copy link
Copy Markdown
Member

Adding additional logging to the logic from f29721f (#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

Summary by CodeRabbit

  • Chores
    • Improved diagnostic logging when determining whether the AgenticRun custom resource definition is available, including clearer handling when no client connection is present and reporting the final availability result.
    • Updated startup client initialization to include the necessary API scheme so the runtime client correctly recognizes required API types.
    • No user-facing functionality or behavior changes.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 23, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@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.

Details

In response to this:

Adding additional logging to the logic from f29721f (#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

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.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The 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.

Changes

Runtime client and CRD availability

Layer / File(s) Summary
Runtime controller scheme registration
pkg/start/start.go
RuntimeControllerClientOrDie creates a scheme, registers core Kubernetes, apiextensions/v1, and operator/v1 APIs, and passes it to the runtime client.
AgenticRun CRD availability handling
pkg/agenticrun/controller.go
crdAvailable sets availability to false for nil clients and logs the cached result with the lookup error.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: lgtm

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The patch only changes production code in pkg/start/start.go; no test/spec files or Ginkgo titles were added or modified.
Test Structure And Quality ✅ Passed No test files were added or modified; the PR only changes non-test code, so the Ginkgo test-quality criteria are not applicable.
Microshift Test Compatibility ✅ Passed PR only changes pkg/start/start.go; no new Ginkgo e2e tests or test files were added, so MicroShift compatibility concerns are not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changes are limited to controller/client wiring and logging, so SNO assumptions are not implicated.
Topology-Aware Scheduling Compatibility ✅ Passed Only logging and client scheme registration changed; no pod topology, replicas, node selectors, affinity, or PDB logic were introduced.
Ote Binary Stdout Contract ✅ Passed PASS: The patch only adds klog/info logging and client-scheme setup; no fmt.Print/os.Stdout writes were added, and the main binary routes klog to stderr.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the touched files are controller/client plumbing only, with no IPv4 assumptions or external connectivity.
No-Weak-Crypto ✅ Passed The patch only adds logging and an OpenShift API scheme registration; no weak algorithms, custom crypto, or secret comparisons are introduced.
Container-Privileges ✅ Passed The PR only changes Go logging/client setup; no manifest changes introduce privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed PASS: The only new log is a fixed CRD-availability message plus the GET error; no secrets, PII, or customer data are logged, and start.go adds no logging.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the logging improvement to AgenticRun CRD detection, which is a real part of the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2026
@wking
wking force-pushed the agentic-run-crd-detection-transparency branch from 91ca40b to 9b64dca Compare July 24, 2026 04:38
…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
@wking
wking force-pushed the agentic-run-crd-detection-transparency branch from 9b64dca to d8505c7 Compare July 24, 2026 04:38
wking added a commit to wking/cluster-version-operator that referenced this pull request Jul 24, 2026
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.
wking added 2 commits July 23, 2026 22:41
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.
@wking
wking force-pushed the agentic-run-crd-detection-transparency branch from 714357e to 2eafe1a Compare July 24, 2026 05:41

@jhadvig jhadvig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jhadvig

jhadvig commented Jul 24, 2026

Copy link
Copy Markdown
Member

/retitle OTA-2097, OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection

@openshift-ci openshift-ci Bot changed the title OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection OTA-2097, OTA-2084: pkg/agenticrun/controller: Additional logging to AgenticRun CRD detection Jul 24, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@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.

Details

In response to this:

Adding additional logging to the logic from f29721f (#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

Summary by CodeRabbit

  • Chores
  • Improved diagnostic logging when determining whether the AgenticRun custom resource definition is available, including clearer handling when no client connection is present and reporting the final availability result.
  • Updated startup client initialization to include the necessary API scheme so the runtime client correctly recognizes required API types.
  • No user-facing functionality or behavior changes.

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.

@wking

wking commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

/retest-required

@wking

wking commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Azure CI is having some issues, but I'm confident they're unrelated to this pull.

/override ci/prow/e2e-agnostic-ovn
/override ci/prow/e2e-agnostic-ovn-techpreview-serial-2of3
/override ci/prow/e2e-agnostic-ovn-techpreview-serial-3of3
/override ci/prow/e2e-agnostic-ovn-upgrade-into-change
/override ci/prow/e2e-agnostic-ovn-upgrade-out-of-change

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@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

Details

In response to this:

Azure CI is having some issues, but I'm confident they're unrelated to this pull.

/override ci/prow/e2e-agnostic-ovn
/override ci/prow/e2e-agnostic-ovn-techpreview-serial-2of3
/override ci/prow/e2e-agnostic-ovn-techpreview-serial-3of3
/override ci/prow/e2e-agnostic-ovn-upgrade-into-change
/override ci/prow/e2e-agnostic-ovn-upgrade-out-of-change

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.

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@wking: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@wking

wking commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

/verified by CI and my own pre-testing

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@wking: This PR has been marked as verified by CI and my own pre-testing.

Details

In response to this:

/verified by CI and my own pre-testing

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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 6e71933 into openshift:main Jul 24, 2026
19 checks passed
@wking
wking deleted the agentic-run-crd-detection-transparency branch July 24, 2026 17:06
jrangelramos added a commit to jrangelramos/cluster-version-operator that referenced this pull request Jul 27, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants