Skip to content

chore: refactor read scheme to openapi from kubernetes api definition#6190

Open
koba1t wants to merge 1 commit into
kubernetes-sigs:masterfrom
koba1t:agent/openapi-artifact-compiler
Open

chore: refactor read scheme to openapi from kubernetes api definition#6190
koba1t wants to merge 1 commit into
kubernetes-sigs:masterfrom
koba1t:agent/openapi-artifact-compiler

Conversation

@koba1t

@koba1t koba1t commented Jul 17, 2026

Copy link
Copy Markdown
Member

Related to #5016.

What this PR does

  • Adds a deterministic compiler for a versioned, gzip-compressed built-in OpenAPI bundle.
  • Embeds the compiled bundle with go:embed and loads the built-in schema from it at runtime.
  • Preserves the existing exported asset APIs for compatibility.
  • Removes go-bindata and kind from the built-in schema generation workflow.
  • Retains the Kubernetes OpenAPI protobuf in compressed form as compiler input without linking it into the normal kustomize binary.

This is the artifact-compiler migration only. The generated bundle still represents Kubernetes v1.21.2; combining API definitions from multiple Kubernetes releases will be handled separately.

Why

The existing generated Go assets embed and decode a single Kubernetes OpenAPI protobuf at runtime. Moving that conversion to a deterministic build-time compiler creates a versioned artifact boundary for a future union of Kubernetes API definitions while avoiding additional runtime data and dependencies.

In a local comparison, the resulting kustomize binary was 201,408 bytes smaller (17,396,722 bytes to 17,195,314 bytes).

Special notes for reviewers

The .bundle-v1.json.gz and swagger.pb.gz files are generated artifacts. Their generation and verification commands are documented in kyaml/openapi/README.md.

AI disclosure: This PR was written in part with the assistance of generative AI.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubernetes-prow kubernetes-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 17, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koba1t

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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2026
@koba1t
koba1t force-pushed the agent/openapi-artifact-compiler branch from 7d9bba2 to 692fd5d Compare July 17, 2026 08:35
Previously, only a single embedded Kubernetes API version could be specified, resulting in a lack of support for certain GVKs.
To address this, the goal is to create and utilize a unified scheme that consolidates Kubernetes API definitions.
As a preliminary step, the current method of loading API definitions will be improved.
@koba1t
koba1t force-pushed the agent/openapi-artifact-compiler branch from 692fd5d to f07ebf5 Compare July 17, 2026 08:39
@koba1t
koba1t marked this pull request as ready for review July 17, 2026 08:45
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2026
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant