-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
kubectl scale fails to scale a CustomResource if resourceVersion is not provided #80515
Comments
/sig api-machinery |
/sub |
I've created a test cluster based on #80572 and I can confirm that I'm able to scale CustomResources using I used an example resource to test this, such as:
Thanks a lot @knight42 for your time spent fixing this! |
@liggitt Bug triage for 1.17 here with a gentle reminder that code freeze for this release is on November 14. Is this issue still intended for 1.17? I see you move it to 1.17 so I just wanted to be sure. |
It is in the review queue and should still make 1.17 |
@liggitt a kind reminder that code freeze for this release is on November 14. |
Yes this should merge early in the week |
@liggitt Code freeze is tomorrow, this still going to make it? |
yes, #80572 is still planned |
What happened:
Using a
scale
command such as:fails with the following error:
This bug happens on each run and started occurring as of
kubectl
v1.15.0. Withkubectl
v1.14 or older, I don't have such problem, i.e. it works flawlessly.What you expected to happen:
The
kubectl scale
command succeeds:How to reproduce it (as minimally and precisely as possible):
Create a CRD that has the scale subresource and try to scale a CR using
kubectl
. Example of such CRD can be found here.Anything else we need to know?:
Regarding the
kubectl
bug, it seems that it started appearing as of #75210. Before the PR, we always fetched the resource and it worked because it had the resource version, while now we are only fetching it in case preconditions are provided (preconditions are not provided by default/when usingkubectl
).Here is the
-v8
output of akubectl scale
command:If I manually craft the request that has the resource version (or use the
--resource-version
flag), it works.Is it as expected that the
autoscaling/v1
Scale resource requires the resource version in order for update to succeed? Shouldn't it always pick the latest resource version in case it isn't provided?On that note, I also noticed that if you want to update a CR by crafting the request manually and using
curl
, you also need to specify the resource version or you will get the same error. I'm not sure if this is expected and related, but I'm writing it down as it might be related. As far as I know, this is not required for some native resources at all, but I'm not sure is this the case for CRDs.Environment:
kubectl version
):The text was updated successfully, but these errors were encountered: