Is your feature request related to a problem? Please describe.
It's currently a bit tricky to figure out if a Plan is "complete" - you need to check that every node matching the plan's selector has a plan.upgrade.cattle.io/my-job label matching the plan's latestHash. While this is doable, I don't think it can be done in a one-liner, and in particular means that you can't kubectl wait on a plan completing.
Describe the solution you'd like
It'd be great if the SUC would add a Complete: True condition to the plan when all of the selected nodes have completed the current revision of the plan. This would align with e.g. the k8s Job's conditions and allow you to easily wait on completion: kubectl wait --for=condition=Complete plan my-plan.
Describe alternatives you've considered
Some things like rke2-upgrade try to do this by looking at the status.applying field, but that seems a bit racy - you might load the plan before it's been mutated by the SUC and think it's complete.
Additional context
Unlike a job, a plan can transition out of the completed state if new nodes start to match the plan's selector but I don't think that's too surprising.
Is your feature request related to a problem? Please describe. It's currently a bit tricky to figure out if a
Plan
is "complete" - you need to check that every node matching the plan's selector has aplan.upgrade.cattle.io/my-job
label matching the plan'slatestHash
. While this is doable, I don't think it can be done in a one-liner, and in particular means that you can'tkubectl wait
on a plan completing.Describe the solution you'd like It'd be great if the SUC would add a
Complete: True
condition to the plan when all of the selected nodes have completed the current revision of the plan. This would align with e.g. the k8sJob
's conditions and allow you to easily wait on completion:kubectl wait --for=condition=Complete plan my-plan
.Describe alternatives you've considered Some things like rke2-upgrade try to do this by looking at the
status.applying
field, but that seems a bit racy - you might load the plan before it's been mutated by the SUC and think it's complete.Additional context Unlike a job, a plan can transition out of the completed state if new nodes start to match the plan's selector but I don't think that's too surprising.