Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client-go: cannot create/update resource with server-side apply on client-go fake clientset #103816

Closed
sanposhiho opened this issue Jul 21, 2021 · 16 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@sanposhiho
Copy link
Member

sanposhiho commented Jul 21, 2021

Hello team.

What happened:

https://github.com/kubernetes/client-go/blob/ac207faedfb64acd5b99a2fb309b7044918b4dda/kubernetes/typed/core/v1/fake/fake_node.go#L138-L157

FakeNodes has Apply method, but we cannot create/update resource with server-side apply with this method.
And creating new resource and updating exist resource have different error message.

# create new resource
 nodes "nodename" not found

# update exist resource
PatchType is not supported 

What you expected to happen:

(1) support ApplyPatchType or (2) creating new resource makes the same error as updating (= PatchType is not supported)

How to reproduce it (as minimally and precisely as possible):

apply resource with fake clientset

Anything else we need to know?:

Environment:

  • client-go version: latest
@sanposhiho sanposhiho added the kind/bug Categorizes issue or PR as related to a bug. label Jul 21, 2021
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 21, 2021
@sanposhiho
Copy link
Member Author

I'd like to take this issue
/assign

@sanposhiho sanposhiho changed the title client-go: cannot create new resource with server-side apply on client-go fake clientset client-go: cannot create/update resource with server-side apply on client-go fake clientset Jul 21, 2021
@neolit123
Copy link
Member

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 22, 2021
@sanposhiho
Copy link
Member Author

I have no good idea to implement server-side apply logic on PatchActionImpl to support ApplyPatchType 😢
For now, I changed the error message on creating new resource with serverside apply. #103821

@fedebongio
Copy link
Contributor

/cc @apelisse @leilajal @kwiesmueller
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 27, 2021
@apelisse
Copy link
Member

We've discussed that with @jpbetz before. Not sure that's something we want to do.

@jpbetz
Copy link
Contributor

jpbetz commented Jul 27, 2021

We've discussed that with Joe Betz before. Not sure that's something we want to do.

See our earlier discussion about this and the doc we wrote on the topic for more detail.

@sanposhiho
Copy link
Member Author

Hello.
OK, So this issue is duplicated with #99953. I'll close it with #103821, thanks

@howardjohn
Copy link
Contributor

I don't think #103821 closes this since it just makes the error better.

@sanposhiho
Copy link
Member Author

Hi @howardjohn
We can see two problems in this issue.

  • fake clientset doesn't support server-side apply
  • for the current situation, error message is not appropriate because user cannot know fake clientset doesn't support server-side apply from error message.

And the first one is duplicated with #99953. So I think it is ok to close this issue with #103821, because the PR will fix the second one.

@sanposhiho
Copy link
Member Author

sanposhiho commented Oct 20, 2021

Aha, #99953 was closed because of non-update. I'll reopen it.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 18, 2022
@sanposhiho
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 18, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 18, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 18, 2022
@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 18, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. triage/accepted Indicates an issue or PR is ready to be actively worked on.
8 participants