Skip to content

Rename removeContainer to removeSection - #19

Merged
mbakalarski merged 1 commit into
mainfrom
remove-section
Jul 30, 2026
Merged

Rename removeContainer to removeSection#19
mbakalarski merged 1 commit into
mainfrom
remove-section

Conversation

@mbakalarski

Copy link
Copy Markdown
Member

removeContainer makes you guess. In a Kubernetes API "container" 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 sectionno 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), so the flag now says what it does.

Scope

before after
spec.removeContainer spec.removeSection
build_remove_path(path, remove_container=…) build_remove_path(path, remove_section=…)

Behaviour is unchanged. The flag only ever applies to a nested cmds path; a single-line path is removed as itself either way (fn.py third branch).

Breaking: the XR spec field is renamed, so netclab-xp's EosCommand XRD moves with it — its printer column CONTAINER_RM becomes SECTION_RM, and its dependsOn floor 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 65001 behind, 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_path still 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

"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>
@mbakalarski
mbakalarski merged commit 334ba57 into main Jul 30, 2026
2 checks passed
@mbakalarski
mbakalarski deleted the remove-section branch July 30, 2026 11:34
@mbakalarski mbakalarski mentioned this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant