Rename removeContainer to removeSection - #19
Merged
Merged
Conversation
"container" is the wrong word in a Kubernetes API: it already means a pod container, so `removeContainer: true` on a resource that configures a router reads as something it is not. What the flag actually does is take out the enclosing EOS config section -- `no router bgp 65001` -- rather than entering that section and negating one line inside it. "section" is the device's own vocabulary: `show running-config section bgp`. The flag now says what it does without a guess. Breaking: the XR spec field is renamed, so netclab-xp's EosCommand XRD has to move with it. The flag only ever applies to a nested `cmds` path; a single-line path is still removed as itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
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.
removeContainermakes you guess. In a Kubernetes API "container" already means a pod container, soremoveContainer: trueon a resource that configures a router reads as something it is not.What the flag actually does is take out the enclosing EOS config section —
no router bgp 65001— rather than entering that section and negating one line inside it.sectionis the device's own vocabulary (show running-config section bgp), so the flag now says what it does.Scope
spec.removeContainerspec.removeSectionbuild_remove_path(path, remove_container=…)build_remove_path(path, remove_section=…)Behaviour is unchanged. The flag only ever applies to a nested
cmdspath; a single-line path is removed as itself either way (fn.pythird branch).Breaking: the XR spec field is renamed, so netclab-xp's
EosCommandXRD moves with it — its printer columnCONTAINER_RMbecomesSECTION_RM, and itsdependsOnfloor rises to this release.Context
Found while exercising netclab-xp's scenarios against live cEOS. Tearing down the JSON-RPC scenario left an empty
router bgp 65001behind, because removing a nested setting means entering its block and entering a block in configure mode creates it. That is exactly the distinction this flag controls, and its name was the reason it took a detour to find.Not addressed here:
build_remove_pathstill has no test, in a suite of two. It is the function that decides whether a device keeps or loses a whole config section, so it is worth one — separately.🤖 Generated with Claude Code