Skip to content

Conversation

@jianzhangbjz
Copy link
Member

@jianzhangbjz jianzhangbjz commented Jan 29, 2026

Description of the change:

The oc explain packagemanifests --api-version=packages.operators.coreos.com/v1 command was failing because:

  1. The OpenAPI schema didn't have the x-kubernetes-group-version-kind extension
  2. The NewDefinitionNamer couldn't find the matching model name in the OpenAPI definitions map

Motivation for the change:
To address openshift/operator-framework-olm#1208 (comment)

{  fail [github.com/openshift/origin/test/extended/cli/explain.go:608]: Unexpected error:
    <*errors.errorString | 0xc0015b8140>: 
    Error running oc --namespace=e2e-test-oc-explain-2xzmz --kubeconfig=/tmp/configfile168747619 explain packagemanifests --api-version=packages.operators.coreos.com/v1:
    StdOut>
    GROUP:      packages.operators.coreos.com
    KIND:       PackageManifest
    VERSION:    v1
    StdErr>
    error: GVK map[group:packages.operators.coreos.com kind:PackageManifest version:v1] not found in OpenAPI schema
    exit status 1
    : error: GVK map[group:packages.operators.coreos.com kind:PackageManifest version:v1] not found in OpenAPI schema
    {
        s: "Error running oc --namespace=e2e-test-oc-explain-2xzmz --kubeconfig=/tmp/configfile168747619 explain packagemanifests --api-version=packages.operators.coreos.com/v1:\nStdOut>\nGROUP:      packages.operators.coreos.com\nKIND:       PackageManifest\nVERSION:    v1\nStdErr>\nerror: GVK map[group:packages.operators.coreos.com kind:PackageManifest version:v1] not found in OpenAPI schema\nexit status 1\n: error: GVK map[group:packages.operators.coreos.com kind:PackageManifest version:v1] not found in OpenAPI schema",
    }

Architectural changes:

With this fix:

  1. ToOpenAPIDefinitionName() calls OpenAPIModelName() which returns the canonical name
  2. The generated OpenAPI uses the same name via v1.PackageManifest{}.OpenAPIModelName()
  3. NewDefinitionNamer finds the match and adds the GVK extension
  4. oc explain can now find the schema by GVK

Testing remarks:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

Assisted-By: Claude-Code

@openshift-ci openshift-ci bot requested review from anik120 and kevinrizza January 29, 2026 09:58
@openshift-ci
Copy link

openshift-ci bot commented Jan 29, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign oceanc80 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant