rancher / system-agent

Apache License 2.0
21 stars 43 forks source link

Add ResetFailureCountOnServiceRestart #201

Closed HarrisonWAffel closed 1 week ago

HarrisonWAffel commented 2 weeks ago

Issue: https://github.com/rancher/rancher/issues/42458, https://github.com/rancher/rancher/issues/46620, RFC-13

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.

HarrisonWAffel commented 1 week ago

After discussing this with @Oats87 this PR has been updated to move the ResetFailureCountOnStartup field from the OneTimeInstruction struct to the Plan struct