Skip to content

KEP-5589 - drop gogo runtime dependencies#134256

Merged
k8s-ci-robot merged 4 commits intokubernetes:masterfrom
liggitt:protoc-gogo-poc
Oct 8, 2025
Merged

KEP-5589 - drop gogo runtime dependencies#134256
k8s-ci-robot merged 4 commits intokubernetes:masterfrom
liggitt:protoc-gogo-poc

Conversation

@liggitt
Copy link
Copy Markdown
Member

@liggitt liggitt commented Sep 25, 2025

What type of PR is this?

/kind cleanup
/kind feature

What this PR does / why we need it:

Completes the first phase of kubernetes/enhancements#5589

  1. Drops all runtime dependencies on the unmaintained gogo protobuf from kube API types
  2. Drops unused generated protobuf methods
  3. Relocates the ProtoMessage() marker method on Kubernetes REST API types behind a kubernetes_protomessage_one_more_release build tag. This was a misleading marker method, since gogo-generated types are not fully compliant with what the standard protobuf library expects (it describes these as "aberrant messages" and has only best-effort support for them)

These changes are accomplished by updating our existing post-gogo-generation rewrite step to:

  • relocate empty ProtoMessage() methods to a separate build-tagged file
  • drop unused proto registrations, type assertions, and variable declarations using gogo proto types
  • switch from a gogo String sorter utility function to use sort.Strings directly

This limits gogo dependencies for kube API types to code-generator generation time

Which issue(s) this PR is related to:

kubernetes/enhancements#5589

#96564

Does this PR introduce a user-facing change?

Kubernetes API Go types removed runtime use of the github.com/gogo/protobuf library, and are no longer registered into the global gogo type registry. Kubernetes API Go types were not suitable for use with the google.golang.org/protobuf library, and no longer implement `ProtoMessage()` by default to avoid accidental incompatible use. If removal of these marker methods impacts your use, it can be re-enabled for one more release with a `kubernetes_protomessage_one_more_release` build tag, but will be removed in 1.36.

/sig api-machinery
/hold

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 25, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/code-generation area/dependency Issues or PRs related to dependency changes area/kube-proxy area/kubectl area/kubelet kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels Sep 25, 2025
@k8s-ci-robot k8s-ci-robot added the sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. label Sep 25, 2025
@github-project-automation github-project-automation Bot moved this to Needs Triage in SIG Apps Sep 25, 2025
@k8s-ci-robot k8s-ci-robot added sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Sep 25, 2025
@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. labels Sep 25, 2025
@liggitt liggitt changed the title KEP-5598 - drop gogo runtime dependencies KEP-5589 - drop gogo runtime dependencies Oct 7, 2025
@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Oct 7, 2025

KEP is merged, this is ready for review and completes phase 1 of kubernetes/enhancements#5589 (removal of runtime dependencies).

@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Oct 7, 2025

As unpleasant as it is, the Regenerate protobuf commit should actually be reviewed (ignoring whitespace with ?w=1 makes it a little better) to verify it is strictly only doing the following three things:

  1. deleting unused code
  2. relocating ProtoMessage() methods to a build-tagged file
  3. switching to use the stdlib sort package directly

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 7, 2025
@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Oct 8, 2025

/retest

@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Oct 8, 2025

/assign @jpbetz
/cc @benluddy

Copy link
Copy Markdown
Contributor

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

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

Two questions then LGTM. That the generated code compiles is sufficient to convince me that this is correct. Thanks!

@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Oct 8, 2025

pushed godoc updates to clarify the generator functions

@jpbetz
Copy link
Copy Markdown
Contributor

jpbetz commented Oct 8, 2025

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 82654caf262e9f59468b1f6765d1b2bf978febf7

@benluddy
Copy link
Copy Markdown
Contributor

benluddy commented Oct 8, 2025

/lgtm

@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Oct 8, 2025

/hold cancel

@k8s-triage-robot
Copy link
Copy Markdown

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@dims
Copy link
Copy Markdown
Member

dims commented Oct 8, 2025

/approve
/lgtm

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, jpbetz, liggitt

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

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. area/apiserver area/code-generation area/dependency Issues or PRs related to dependency changes area/kube-proxy area/kubectl area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.

Projects

Archived in project
Archived in project
Archived in project
Archived in project
Archived in project
Archived in project

Development

Successfully merging this pull request may close these issues.