This PR adds the ResetFailureCountOnStartup field to the OneTimeInstruction struct. If this field is set to true, during the initial force application of the one-time instruction set the plans failure-count and applied-checksum fields will be reset. This ensures that the max-failures field is always respected, even if the plan had previously succeeded when executed by a prior instance of the system-agent. Due to the fact that the failure-count and applied-checksum fields are stored at the top level (and not as an attribute of the plan key) this will occur if any of the one time instructions set ResetFailureCountOnStartup to true.
After discussing this with @Oats87 this PR has been updated to move the ResetFailureCountOnStartup field from the OneTimeInstruction struct to the Plan struct
Issue: https://github.com/rancher/rancher/issues/42458, https://github.com/rancher/rancher/issues/46620, RFC-13
This PR adds the
ResetFailureCountOnStartup
field to theOneTimeInstruction
struct. If this field is set to true, during the initial force application of the one-time instruction set the plansfailure-count
andapplied-checksum
fields will be reset. This ensures that themax-failures
field is always respected, even if the plan had previously succeeded when executed by a prior instance of the system-agent. Due to the fact that thefailure-count
andapplied-checksum
fields are stored at the top level (and not as an attribute of theplan
key) this will occur if any of the one time instructions setResetFailureCountOnStartup
to true.