Skip to content

[dcaas] Implement Bundle Interfaces #145

Open
sven-rosenzweig wants to merge 4 commits intomainfrom
feat/bundleiface
Open

[dcaas] Implement Bundle Interfaces #145
sven-rosenzweig wants to merge 4 commits intomainfrom
feat/bundleiface

Conversation

@sven-rosenzweig
Copy link
Copy Markdown
Contributor

No description provided.

@sven-rosenzweig sven-rosenzweig requested a review from a team as a code owner December 18, 2025 13:04
@hardikdr hardikdr added the area/metal-automation Automation processes within the Metal project. label Jan 13, 2026
@hardikdr hardikdr added this to Roadmap Jan 13, 2026
@felix-kaestner felix-kaestner force-pushed the main branch 2 times, most recently from 64984b9 to f71555b Compare January 15, 2026 10:26
@felix-kaestner felix-kaestner force-pushed the main branch 4 times, most recently from aed4596 to 8d57167 Compare January 26, 2026 13:42
@sven-rosenzweig sven-rosenzweig force-pushed the feat/bundleiface branch 3 times, most recently from ef97c0e to 6789276 Compare February 6, 2026 13:31
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please invoke make charts to also regenerate the Helm Chart incl. this CRD.

if string(b) != "[null]" {

// Due to some Cisco IOSX ouptut we also match [ \n null \n]
nullTypeRe := regexp.MustCompile(`^\[\s*null\s*]$`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: can you move this variable outside of the function, so that we don't recreated this regexp instance on every function call?

EtherBundle IFaceSpeed = "etherbundle"
)

type BunldePortActivity string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo

StateShutDown PhysIfStateType = "im-state-shutdown"
)

// Represent physical and bundle interfaces as part of the same struct as they share a lot of common configuration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Represent physical and bundle interfaces as part of the same struct as they share a lot of common configuration
// Iface represents physical and bundle interfaces as part of the same struct as they share a lot of common configuration

Type comments should start with the type name.

}
if string(b) != "[null]" {

// Due to some Cisco IOSX ouptut we also match [ \n null \n]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Due to some Cisco IOSX ouptut we also match [ \n null \n]
// Due to some Cisco IOS-XR output we also match [ \n null \n]

Comment on lines +119 to +122
func (m *MockClient) Create(ctx context.Context, conf ...gnmiext.Configurable) error {
return nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this was left by mistake and should be removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please don't introduce a util package for reasons explained in the Google Go Styleguide 1.

At the same time, as both functions are pretty simple and could be just oneline statements, I would just inline them in the only place they are currently used.

Footnotes

  1. https://google.github.io/styleguide/go/decisions#naming:~:text=Avoid%20uninformative%20package%20names%20like%20util%2C%20utility%2C%20common%2C%20helper%2C%20model%2C%20testhelper%2C%20and%20so%20on%20that%20would%20tempt%20users%20of%20the%20package%20to%20rename%20it%20when%20importing%2E%20See.

@hardikdr hardikdr added area/switch-automation Automation processes for network switch management and operations. and removed area/metal-automation Automation processes within the Metal project. labels Mar 23, 2026
In Cisco IOS XR the yang empty type is not implemented correctly for
bundle-interfaces.
Instead of returning "[null]" as defined in the RFC, "[\n null \n]" is.

We simply work around of this.
For Bundle- and Bundlesubinterfaces creation fails, as the gnmi Update/Patch call,
checks whether the object exists or not. We skip this check once if the
gnmi call returns a NotFound error code.
@sven-rosenzweig sven-rosenzweig force-pushed the feat/bundleiface branch 3 times, most recently from 6909264 to 3af44d9 Compare March 27, 2026 09:02
@github-actions
Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/provider/cisco/gnmiext/v2 90.62% (+0.05%) 👍
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr 31.46% (-16.64%) 💀

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1/interface_types.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/internal/provider/cisco/gnmiext/v2/client.go 88.61% (+0.07%) 158 (+1) 140 (+1) 18 👍
github.com/ironcore-dev/network-operator/internal/provider/cisco/gnmiext/v2/empty.go 100.00% (ø) 10 10 0
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/intf.go 19.30% (-26.86%) 57 (+44) 11 (+5) 46 (+39) 💀 💀
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/provider.go 37.19% (-11.29%) 121 (+55) 45 (+13) 76 (+42) 💀

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/intf_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants