projectsyn / component-system-upgrade-controller

Commodore Component for managing System Upgrade Controller
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Add field "prepare" to plan #36

Closed anothertobi closed 2 years ago

anothertobi commented 2 years ago

Context

When the image tag delivered by floodgate is not actually available, SUC will fail to pull the image after draining a node. This leaves the node cordoned and node-specific workloads will experience unnecessary downtime.

Therefore, I'd like to have the option to specify the prepare field for a plan (incl. subfields, see https://github.com/rancher/system-upgrade-controller). According to the documentation, this "is run before cordon/drain which is run before the upgrade container". With that, we could run a dummy command (e.g. true) in the prepare step and if that fails to pull the image, no node will be drained.

Related to https://github.com/projectsyn/system-upgrade-controller-package-upgrade/issues/20

Alternatives

I could specify a plan resource without this component, which is not desirable.

simu commented 2 years ago

Idea: change component to allow arbitrary fields when specifying plans. This would match our documented best practices for components which state that all fields of CRs created by components should be able to be configured from the hierarchy.

To this effect, I'd propose that we change the implementation so that entries in parameter plans automatically support any fields which are valid in a plans.upgrade.cattle.io resource.