Skip to content

🐛 Update typed Applyconfigurations with server response#3475

Open
alvaroaleman wants to merge 1 commit intokubernetes-sigs:mainfrom
alvaroaleman:fixfix
Open

🐛 Update typed Applyconfigurations with server response#3475
alvaroaleman wants to merge 1 commit intokubernetes-sigs:mainfrom
alvaroaleman:fixfix

Conversation

@alvaroaleman
Copy link
Copy Markdown
Member

Prior to this, we would never update a typed applyconfiguration with the response from the server, this change fixes that.

Fixes #3474

Prior to this, we would never update a typed applyconfiguration with the
response from the server, this change fixes that.
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 8, 2026
@alvaroaleman
Copy link
Copy Markdown
Member Author

One question is if we should backport this, the problem with that is that it may break existing code, since the response contains a resource version, so when re-using an object to do multiple requests that would have previously worked but won't anymore after this

Copy link
Copy Markdown
Member

@dongjiang1989 dongjiang1989 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 Mar 10, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 6568e3587eae1c7ea853eeeecea75a2f32d1d70d

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, dongjiang1989

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

@sbueringer
Copy link
Copy Markdown
Member

sbueringer commented Mar 10, 2026

/hold

We should discuss this a bit

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 10, 2026
return err
}

return json.Unmarshal(body, obj)
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.

Do we have to do some sort of zeroing on the obj?


err = cl.Apply(ctx, obj, &client.ApplyOptions{FieldManager: "test-manager"})
Expect(err).NotTo(HaveOccurred())
Expect(obj.ResourceVersion).NotTo(BeNil())
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.

Can we add something similar for subresource Apply?

@sbueringer
Copy link
Copy Markdown
Member

We should discuss this a bit

Added my take on the issue

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply using typed apply configurations doesn't deserialize the response into the passed object

4 participants