Skip to content

Commit

Permalink
NCSDEV-11024: fix go workflow non compliances
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing Zhang committed Nov 30, 2023
1 parent b4eabf3 commit 3f11361
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ func validateCNIConfigSriov(config []byte) error {
}
if vlanExists {
vlanString := fmt.Sprintf("%v", vlan)
vlanId, err1 := strconv.Atoi(vlanString)
vlanID, err1 := strconv.Atoi(vlanString)
if err1 != nil {
return fmt.Errorf("vlan field format error")
}
if checkInfraVlan {
for i := 0; i < len(infraVlans); i++ {
if infraVlans[i] == vlanId {
if infraVlans[i] == vlanID {
return fmt.Errorf("infrastructure vlan id %d shall not be used in vlan field", infraVlans[i])
}
}
Expand Down Expand Up @@ -182,12 +182,12 @@ func validateCNIConfigSriov(config []byte) error {
qos, qosExists := c["vlanQoS"]
if qosExists {
qosString := fmt.Sprintf("%v", qos)
qosId, err1 := strconv.Atoi(qosString)
qosID, err1 := strconv.Atoi(qosString)
if err1 != nil {
return fmt.Errorf("qos field format error")
}
if qosId != 0 {
return fmt.Errorf("qos %v is defined while only default qos (0) is allowed", qosId)
if qosID != 0 {
return fmt.Errorf("qos %v is defined while only default qos (0) is allowed", qosID)
}
}
}
Expand Down

0 comments on commit 3f11361

Please sign in to comment.