Skip to content

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Jul 8, 2025

What this PR does / why we need it:
Currently we're sending too much information in our runtime hook requests.

This PR optimizes the runtime hook request sizes by dropping:

  • metadata.managedFields
  • well-known annotations that we don't want to send (last-applied-configuration + conversion)
  • Cluster.status

Kudos to @fabriziopandini for the idea!

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label labels Jul 8, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 8, 2025
@sbueringer sbueringer added area/runtime-sdk Issues or PRs related to Runtime SDK area/clusterclass Issues or PRs related to clusterclass labels Jul 8, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Jul 8, 2025
@sbueringer
Copy link
Member Author

/assign @fabriziopandini

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer force-pushed the pr-optimize-runtime-calls branch from 45cddad to e1e59cb Compare July 8, 2025 12:47
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@@ -1185,6 +1187,22 @@ func TestComputeControlPlaneVersion(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "test-cluster",
Namespace: "test-ns",
// Add managedFields and annotations that should be cleaned up before the Cluster is sent to the RuntimeExtension.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we confident that a runtime extension wouldn't be relying on the managed fields at all?

Copy link
Member Author

@sbueringer sbueringer Jul 8, 2025

Choose a reason for hiding this comment

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

I think it shouldn't depend on the information when which field was written by whom.

As this is all still alpha, I think it's a good time to drop this info.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't actually know that nobody is using this, but in my opinion it's very very unlikely.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack, happy to take the risk and see who complains, one of those things of, if it's there, someone is probably using it, but lets see

Copy link
Member Author

Choose a reason for hiding this comment

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

ManagedFields are really hard to consume :)

@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jul 8, 2025
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1762205563bea29118ce5be2f947ab626508a0d2

@sbueringer
Copy link
Member Author

/override pull-cluster-api-e2e-main
Only the expected flake

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Overrode contexts on behalf of sbueringer: pull-cluster-api-e2e-main

In response to this:

/override pull-cluster-api-e2e-main
Only the expected flake

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.

@JoelSpeed
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2025
@k8s-ci-robot k8s-ci-robot merged commit a7cd691 into kubernetes-sigs:main Jul 9, 2025
20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.11 milestone Jul 9, 2025
@sbueringer sbueringer deleted the pr-optimize-runtime-calls branch July 9, 2025 12:26
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/clusterclass Issues or PRs related to clusterclass area/runtime-sdk Issues or PRs related to Runtime SDK cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants