Skip to content

dynamicconfig: detect and remove config options on delete #39303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

jshr-w
Copy link
Contributor

@jshr-w jshr-w commented May 3, 2025

This change enables the calculation of the diff of an existing statedb table and the values being inserted, so that the dynamicconfig reflector can detect removed options and delete them from the statedb table.

Fixes: #38621

dynamicconfig: detect and remove config options on delete

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 3, 2025
@jshr-w jshr-w force-pushed the jshr/dynamicconfigremove branch from 6725a9b to e136d30 Compare May 3, 2025 00:01
jshr-w added 2 commits May 2, 2025 17:01
ConfigMap key deletions do not have entry.deleted set to true, and so
are leaked on update. Add an option to capture the diff in rows
between the existing table and updated rows, so that keys that need
to be deleted can be calculated.

Signed-off-by: jshr-w <shjayaraman@microsoft.com>
Signed-off-by: jshr-w <shjayaraman@microsoft.com>
@jshr-w jshr-w force-pushed the jshr/dynamicconfigremove branch from e136d30 to 01ea19d Compare May 3, 2025 00:01
@jshr-w
Copy link
Contributor Author

jshr-w commented May 3, 2025

/test

@jshr-w jshr-w marked this pull request as ready for review May 3, 2025 01:06
@jshr-w jshr-w requested review from a team as code owners May 3, 2025 01:06
Copy link
Contributor

@joamaki joamaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a difficult to understand and use API. The problem is that TransformMany assumed a persistent 1-to-many mapping. I would instead suggest that we make TransformMany return a set of objects to upsert and objects to delete.

E.g. something like:

type TranformManyFunc[Obj any] func(txn statedb.ReadTxn, deleted bool, obj any) (toUpsert, toDelete []Obj)

If it is OK to you I would like to fix this myself.

joamaki added a commit to joamaki/cilium that referenced this pull request May 5, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: cilium#39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
@jshr-w jshr-w closed this May 5, 2025
joamaki added a commit to joamaki/cilium that referenced this pull request May 8, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: cilium#39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 8, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: cilium#39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 9, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: cilium#39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 12, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: cilium#39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request May 12, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: #39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
hsalluri259 pushed a commit to hsalluri259/cilium that referenced this pull request May 14, 2025
Add a script test suite with test cases to verify that the
previous commit fixes the issue of removed keys actually
being deleted from the table.

Issue: cilium#39303
Signed-off-by: Jussi Maki <jussi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-merge/needs-release-note-label The author needs to describe the release impact of these changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamicconfig feature does not detect removal of config options
2 participants