Repository navigation
Conversation
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
AllowFailureonpkg.HookConfigandpkg.ApplicationHookConfigis now propagated to every Kubernetes and Schedule binding in the hook config passed to addon-operator. This is the same fan-out the embedded go_hook API in addon-operator performs.AllowFailurethat is set explicitly, includingfalse, takes precedence over the hook-level value.ScheduleConfiggets anallowFailurefield. Schedule bindings start honoring it once addon-operator copies the field intoScheduleConfigV1(follow-up PR). Older addon-operator versions ignore the unknown field, because the config is decoded withoutDisallowUnknownFields.Why do we need it, and what problem does it solve?
Top-level
AllowFailurewas silently dropped.remapModuleHookConfigandremapApplicationHookConfignever read it, and shell-operator only understandsallowFailureper binding. So a hook declared withAllowFailure: trueactually ran withallowFailure=false. This affects every module-sdk release from v0.10.4 up to v0.14.0. There is no compile or validation error. The existing test only covers the per-binding field.The consequence is severe. When such a hook fails on a Kubernetes Synchronization task, addon-operator requeues the task forever (
queue.Fail). The binding is never marked done, so the module stays inWaitForSynchronization, andModuleRunrepeats at the head of themainqueue. Convergence of all other modules stops until the Deckhouse leader is restarted. This happened in production with a hook in the observability module: aPatchWithMergereturned NotFound for an object deleted between snapshot and patch.The embedded go_hook API, which module-sdk replaces, fans the hook-level flag out to all bindings (
newHookConfigFromGoConfig). Hooks migrated one-to-one therefore lost the semantics silently. Fan-out in the SDK restores the expected behavior. For Kubernetes bindings it works with every already released addon-operator, because they already read the per-binding field. Deprecating the field with a validation error was rejected: it would break hooks that compile today and would diverge from the legacy API semantics.Hooks that already declare
AllowFailure: true(e.g. log-shippergenerate_config) will start tolerating errors as their authors intended. Errors are logged and counted inModuleHookAllowedErrorsTotalinstead of being retried.