44package nxos
55
66import (
7+ "github.com/ironcore-dev/network-operator/api/core/v1alpha1"
78 "github.com/ironcore-dev/network-operator/internal/transport/gnmiext"
89)
910
@@ -26,11 +27,13 @@ type RouteMapEntry struct {
2627 Action Action `json:"action"`
2728 Order int32 `json:"order"`
2829 SrttItems struct {
30+ Additive AdminSt `json:"additive,omitempty"`
2931 ItemItems struct {
3032 ItemList gnmiext.List [ExtCommItem , * ExtCommItem ] `json:"Item-list,omitzero"`
3133 } `json:"item-items,omitzero"`
3234 } `json:"srtt-items,omitzero"`
3335 SregcommItems struct {
36+ Additive AdminSt `json:"additive,omitempty"`
3437 NoCommAttr AdminSt `json:"noCommAttr"`
3538 ItemItems struct {
3639 ItemList gnmiext.List [string , * CommItem ] `json:"Item-list,omitzero"`
@@ -72,7 +75,7 @@ type RouteMapEntry struct {
7275
7376func (e * RouteMapEntry ) Key () int32 { return e .Order }
7477
75- func (e * RouteMapEntry ) SetCommunities (communities []string ) error {
78+ func (e * RouteMapEntry ) SetCommunities (communities []string , options v1alpha1. CommunityOptions ) error {
7679 for _ , comm := range communities {
7780 c , err := Community (comm )
7881 if err != nil {
@@ -81,17 +84,23 @@ func (e *RouteMapEntry) SetCommunities(communities []string) error {
8184 e .SregcommItems .NoCommAttr = AdminStDisabled
8285 e .SregcommItems .ItemItems .ItemList .Set (& CommItem {Community : c })
8386 }
87+ if options == v1alpha1 .CommunityOptionsAdd {
88+ e .SregcommItems .Additive = AdminStEnabled
89+ }
8490 return nil
8591}
8692
87- func (e * RouteMapEntry ) SetExtCommunities (communities []string ) error {
93+ func (e * RouteMapEntry ) SetExtCommunities (communities []string , options v1alpha1. CommunityOptions ) error {
8894 for _ , comm := range communities {
8995 c , err := RouteTarget (comm )
9096 if err != nil {
9197 return err
9298 }
9399 e .SrttItems .ItemItems .ItemList .Set (& ExtCommItem {Community : c , Scope : RtExtComScopeTransitive })
94100 }
101+ if options == v1alpha1 .CommunityOptionsAdd {
102+ e .SrttItems .Additive = AdminStEnabled
103+ }
95104 return nil
96105}
97106
0 commit comments