@@ -27,11 +27,13 @@ type RouteMapEntry struct {
2727 Action Action `json:"action"`
2828 Order int32 `json:"order"`
2929 SrttItems struct {
30+ Additive AdminSt `json:"additive,omitempty"`
3031 ItemItems struct {
3132 ItemList gnmiext.List [ExtCommItem , * ExtCommItem ] `json:"Item-list,omitzero"`
3233 } `json:"item-items,omitzero"`
3334 } `json:"srtt-items,omitzero"`
3435 SregcommItems struct {
36+ Additive AdminSt `json:"additive,omitempty"`
3537 NoCommAttr AdminSt `json:"noCommAttr"`
3638 ItemItems struct {
3739 ItemList gnmiext.List [string , * CommItem ] `json:"Item-list,omitzero"`
@@ -73,7 +75,7 @@ type RouteMapEntry struct {
7375
7476func (e * RouteMapEntry ) Key () int32 { return e .Order }
7577
76- func (e * RouteMapEntry ) SetCommunities (communities []string ) error {
78+ func (e * RouteMapEntry ) SetCommunities (communities []string , options v1alpha1. CommunityOptions ) error {
7779 for _ , comm := range communities {
7880 c , err := Community (comm )
7981 if err != nil {
@@ -82,17 +84,23 @@ func (e *RouteMapEntry) SetCommunities(communities []string) error {
8284 e .SregcommItems .NoCommAttr = AdminStDisabled
8385 e .SregcommItems .ItemItems .ItemList .Set (& CommItem {Community : c })
8486 }
87+ if options == v1alpha1 .CommunityOptionsAdd {
88+ e .SregcommItems .Additive = AdminStEnabled
89+ }
8590 return nil
8691}
8792
88- func (e * RouteMapEntry ) SetExtCommunities (communities []string ) error {
93+ func (e * RouteMapEntry ) SetExtCommunities (communities []string , options v1alpha1. CommunityOptions ) error {
8994 for _ , comm := range communities {
9095 c , err := RouteTarget (comm )
9196 if err != nil {
9297 return err
9398 }
9499 e .SrttItems .ItemItems .ItemList .Set (& ExtCommItem {Community : c , Scope : RtExtComScopeTransitive })
95100 }
101+ if options == v1alpha1 .CommunityOptionsAdd {
102+ e .SrttItems .Additive = AdminStEnabled
103+ }
96104 return nil
97105}
98106
0 commit comments