@@ -45,7 +45,7 @@ type ConfigDB struct {
4545 VXLANTunnelMap VXLANTunnelMap `json:"VXLAN_TUNNEL_MAP,omitempty"`
4646}
4747
48- func GenerateConfigDB (input * values.Values , platform * p.Platform , environment * p.Environment , version * v. Version ) (* ConfigDB , error ) {
48+ func GenerateConfigDB (input * values.Values , platform * p.Platform , environment * p.Environment , version v. Branch ) (* ConfigDB , error ) {
4949 if input == nil {
5050 return nil , fmt .Errorf ("no input values provided" )
5151 }
@@ -284,7 +284,7 @@ func getInterfaces(ports values.Ports, bgpPorts []string, interconnects map[stri
284284 return interfaces
285285}
286286
287- func getLLDP (interval int , version * v. Version ) * LLDP {
287+ func getLLDP (interval int , version v. Branch ) * LLDP {
288288 if interval < 1 {
289289 return nil
290290 }
@@ -294,11 +294,11 @@ func getLLDP(interval int, version *v.Version) *LLDP {
294294 HelloTime : fmt .Sprintf ("%d" , interval ),
295295 }
296296
297- switch version . Branch {
298- case string ( v .Branch202111 ) :
297+ switch version {
298+ case v .Branch202111 :
299299 global202111 := LLDPGlobal202111 (global )
300300 lldp .Global202111 = & global202111
301- case string ( v .Branch202211 ) :
301+ case v .Branch202211 :
302302 global202211 := LLDPGlobal202211 (global )
303303 lldp .Global202211 = & global202211
304304 default :
@@ -504,8 +504,8 @@ func getPortsAndBreakouts(ports values.Ports, breakouts map[string]string, platf
504504 return configPorts , configBreakouts , nil
505505}
506506
507- func getSAG (sag * values.SAG , version * v. Version ) (* SAG , error ) {
508- if version . Branch != string ( v .Branch202211 ) && sag != nil {
507+ func getSAG (sag * values.SAG , version v. Branch ) (* SAG , error ) {
508+ if version != v .Branch202211 && sag != nil {
509509 return nil , fmt .Errorf ("sag configuration only works with sonic versions from the ec202211_ecsonic branch" )
510510 }
511511
@@ -533,13 +533,13 @@ func getVLANs(vlans []values.VLAN) map[string]VLAN {
533533 return configVLANs
534534}
535535
536- func getVLANInterfaces (vlans []values.VLAN , version * v. Version ) (map [string ]VLANInterface , error ) {
536+ func getVLANInterfaces (vlans []values.VLAN , version v. Branch ) (map [string ]VLANInterface , error ) {
537537 vlanInterfaces := make (map [string ]VLANInterface )
538538
539539 for _ , vlan := range vlans {
540540 var vlanInterface VLANInterface
541541
542- if version . Branch != string ( v .Branch202211 ) && vlan .SAG != nil {
542+ if version != v .Branch202211 && vlan .SAG != nil {
543543 return nil , fmt .Errorf ("sag only works for sonic builds from branch ec202211_ecsonic" )
544544 }
545545 var sag string
@@ -583,14 +583,14 @@ func getVLANMembers(vlans []values.VLAN) map[string]VLANMember {
583583 return vlanMembers
584584}
585585
586- func getVRRPInterfaces (vlans []values.VLAN , version * v. Version ) (map [string ]VRRPInterface , error ) {
586+ func getVRRPInterfaces (vlans []values.VLAN , version v. Branch ) (map [string ]VRRPInterface , error ) {
587587 vrrpInterfaces := make (map [string ]VRRPInterface )
588588 for _ , vlan := range vlans {
589589 if vlan .VRRP .Group == "" {
590590 continue
591591 }
592592
593- if version . Branch != string ( v .Branch202111 ) {
593+ if version != v .Branch202111 {
594594 return nil , fmt .Errorf ("vrrp configuration only works with sonic versions from the ec202111 branch" )
595595 }
596596
0 commit comments