Conversation
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
fuldaxxx
marked this pull request as ready for review
November 30, 2026 10:08
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
MonitorConfiggets aKeepManagedFieldsoption (defaultfalse). The option is part ofFactoryIndex, so a monitor with it gets its own informer and never shares one with monitors of the same resource that do not set it.FactoryStore.WithTransformstill runs, butmetadata.managedFieldsis put back after it, both for watch events in the informer and for the initial list intransformObject. Everything else the transform drops stays dropped.TestFactoryStore_KeepManagedFields: two monitors on one resource, with and without the option, give two factories, and only the flagged one seesmanagedFieldsin the initial list and in watch events. The test fails without the change.go test -race ./pkg/kube_events_manager/,go test ./pkg/...and golangci-lint pass.Why do we need it, and what problem does it solve?
WithTransform(#962, backported in #967) lets an embedding application shrink the objects that informers cache. Deckhouse uses it to dropmetadata.managedFieldsfrom every hook informer (Deckhouse v1.76.18). Some hooks filter onmanagedFields: the node-manager hookforce_machine_deployment_replicas_ownershippicks MachineDeployments by the field manager that ownsspec.replicas. With the field stripped before the filter runs, the hook saw no owner and did nothing. During the Deckhouse update from 1.75 to 1.76.18, nelm then prunedspec.replicas, and node groups were scaled to zero and recreated.The option lets such a monitor keep
managedFieldswhile every other monitor keeps the memory savings. It needs a separate informer because informers are shared perFactoryIndex: turning the transform off on a shared informer would hand full objects to every monitor of that resource.Why do we need it in the patch release (if we do)?
Deckhouse 1.76 is built on the shell-operator v1.17 line, and the node-manager fix in Deckhouse release-1.76 needs this option. Clusters on Deckhouse 1.75 update straight to the latest 1.76 patch, so each of them with such MachineDeployments loses those node groups during the update until the fix is released.