Add ability to set cleanupConfigOnExit in the thick client config#1469
Add ability to set cleanupConfigOnExit in the thick client config#1469astro-stan wants to merge 6 commits intok8snetworkplumbingwg:masterfrom
cleanupConfigOnExit in the thick client config#1469Conversation
|
Warning Rate limit exceeded@astro-stan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 34 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughAdds a new configurable Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/server/config/generator.go (1)
130-143: Consider clearingCleanupConfigOnExitin the generated config for consistency.The
Generate()method clears daemon-only fields likeReadinessIndicatorFilebefore generating the multus-shim configuration. SinceCleanupConfigOnExitis consumed only by the Manager (daemon) and not by the shim'sCmdAdd/CmdDel, consider clearing it here for consistency.🔎 Proposed fix
// Readiness indicator file existence is already handled by the // ConfigManager via an fsnotify watch, so CmdAdd/CmdDel don't need to. mc.ReadinessIndicatorFile = "" + mc.CleanupConfigOnExit = nil data, err := json.Marshal(mc) return string(data), err
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
pkg/server/config/generator.gopkg/server/config/manager.go
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/server/config/manager.go (1)
pkg/logging/logging.go (1)
Verbosef(131-133)
🔇 Additional comments (4)
pkg/server/config/generator.go (2)
55-55: LGTM! Field definition is appropriate.The pointer type
*boolcorrectly supports JSONomitemptysemantics, distinguishing between unset, true, and false values.
75-83: LGTM! Default initialization ensures backward compatibility.The initialization pattern correctly provides a default value of
truewhile allowing JSON unmarshaling to override it. This ensuresCleanupConfigOnExitis never nil when constructed viaParseMultusConfig.pkg/server/config/manager.go (2)
46-46: LGTM! Field addition is straightforward.The non-pointer
booltype is appropriate for the Manager struct's internal state.
164-167: LGTM! Conditional cleanup logic correctly implements the feature.The implementation properly gates config file deletion behind the
cleanupConfigOnExitflag, preserving the default behavior (cleanup on exit) while allowing users to disable it. The verbose logging aids troubleshooting.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/configuration.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/configuration.md
64-64: Link fragments should be valid
Expected: #cleanup-config-on-exit; Actual: #Cleanup-Config-On-Exit
(MD051, link-fragments)
🔇 Additional comments (1)
docs/configuration.md (1)
148-156: Documentation section is well-structured and informative.The new section clearly explains the feature's default behavior, the motivation for disabling it (preventing missing interfaces when primary CNI starts first), and the trade-off (potential crash-loops). The caveats are appropriately highlighted.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Looking at the test log, I don't think the failing tests are related to my changes. |
Adds ability to set
cleanupConfigOnExitin the thick client config.Closes #1468
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.