Skip to content

Commit f58990a

Browse files
committed
[NX-OS] Remove vPC creation via annotation
1 parent 05d316c commit f58990a

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

internal/provider/cisco/nxos/provider.go

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"cmp"
88
"context"
99
"crypto/rsa"
10-
"encoding/json"
1110
"errors"
1211
"fmt"
1312
"math"
@@ -32,7 +31,6 @@ import (
3231

3332
const (
3433
SpanningTreePortTypeAnnotation = "nx.cisco.networking.metal.ironcore.dev/spanning-tree-port-type"
35-
VPCDomainAnnotation = "nx.cisco.networking.metal.ironcore.dev/vpc-domain"
3634
)
3735

3836
var (
@@ -571,28 +569,6 @@ func (p *Provider) DeleteEVPNInstance(ctx context.Context, req *provider.EVPNIns
571569
return p.client.Delete(ctx, conf...)
572570
}
573571

574-
var _ gnmiext.Configurable = (*VPCDom)(nil)
575-
576-
type VPCDom struct {
577-
ID int `json:"id"`
578-
AdminSt AdminSt `json:"adminSt"`
579-
PeerGw AdminSt `json:"peerGw"`
580-
PeerSwitch AdminSt `json:"peerSwitch"`
581-
KeepaliveItems struct {
582-
DestIP string `json:"destIp"`
583-
SrcIP string `json:"srcIp"`
584-
Vrf string `json:"vrf"`
585-
PeerlinkItems struct {
586-
AdminSt AdminSt `json:"adminSt"`
587-
ID string `json:"id"`
588-
} `json:"peerlink-items,omitzero"`
589-
} `json:"keepalive-items,omitzero"`
590-
}
591-
592-
func (v *VPCDom) XPath() string {
593-
return "System/vpc-items/inst-items/dom-items"
594-
}
595-
596572
func (p *Provider) EnsureInterface(ctx context.Context, req *provider.EnsureInterfaceRequest) error {
597573
name, err := ShortName(req.Interface.Spec.Name)
598574
if err != nil {
@@ -809,38 +785,6 @@ func (p *Provider) EnsureInterface(ctx context.Context, req *provider.EnsureInte
809785
conf = append(conf, v)
810786
}
811787

812-
if s, ok := req.Interface.GetAnnotations()[VPCDomainAnnotation]; ok {
813-
f2 := new(Feature)
814-
f2.Name = "vpc"
815-
f2.AdminSt = AdminStEnabled
816-
conf = append(conf, f2)
817-
818-
var dom struct {
819-
Src string `json:"src"`
820-
Dst string `json:"dst"`
821-
Vrf string `json:"vrf"`
822-
}
823-
if err := json.Unmarshal([]byte(s), &dom); err != nil {
824-
return err
825-
}
826-
v := new(VPCDom)
827-
v.ID = 1
828-
v.AdminSt = AdminStEnabled
829-
v.PeerGw = AdminStEnabled
830-
v.PeerSwitch = AdminStEnabled
831-
v.KeepaliveItems.DestIP = dom.Dst
832-
v.KeepaliveItems.SrcIP = dom.Src
833-
v.KeepaliveItems.Vrf = dom.Vrf
834-
v.KeepaliveItems.PeerlinkItems.ID = name
835-
v.KeepaliveItems.PeerlinkItems.AdminSt = AdminStEnabled
836-
conf = append(conf, v)
837-
}
838-
839-
// cfg := new(nxv1alpha1.PortChannelConfig)
840-
// if err = req.ProviderConfig.Into(cfg); err == nil {
841-
// return fmt.Errorf("failed to parse port-channel provider config: %w", err)
842-
// }
843-
844788
case v1alpha1.InterfaceTypeRoutedVLAN:
845789
f := new(Feature)
846790
f.Name = "ifvlan"

0 commit comments

Comments
 (0)