openkruise / kruise

Automated management of large-scale applications on Kubernetes (incubating project under CNCF)
https://openkruise.io
Other
4.6k stars 754 forks source link

[BUG] advance daemonset can not undo to previous version #1100

Closed losha228 closed 1 year ago

losha228 commented 1 year ago

What happened: I am testing advanced daemonset, I can see rollout history for the ads, when I rollback to version3, it works well, but when rollback to version2, it said not found for clonesets, it is obvious it is not a clonesets.

$ kubectl kruise rollout history ads/nginx-ds-kruise 
+ kubectl kruise rollout history ads/nginx-ds-kruise
daemonset.apps.kruise.io/nginx-ds-kruise 
REVISION  CHANGE-CAUSE
2         <none>
3         <none>

$ kubectl kruise rollout undo  ads/nginx-ds-kruise --to-revision=3
+ kubectl kruise rollout undo ads/nginx-ds-kruise --to-revision=3
daemonset.apps.kruise.io/nginx-ds-kruise skipped rollback (current template already matches revision 3)

$ kubectl kruise rollout undo  ads/nginx-ds-kruise --to-revision=2
+ kubectl kruise rollout undo ads/nginx-ds-kruise --to-revision=2
error: failed restoring revision 2: clonesets.apps.kruise.io "nginx-ds-kruise" not found

What you expected to happen: daemonset can support undo

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

  1. rollout an ads for several versions
  2. rollback to previous version

Anything else we need to know?:

Environment:

FillZpp commented 1 year ago

@losha228 Thanks for reporting. This must be a bug of openkruise/kruise-tools and I'm going to fix it.

FillZpp commented 1 year ago

@losha228 It has fixed in the latest kubectl-kruise v1.0.5. You can upgrade the command-line tool using krew or manually.