Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Reviews and opti.
Browse files Browse the repository at this point in the history
  • Loading branch information
julienstroheker committed Jul 16, 2018
1 parent 32f2213 commit 3a13d1b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ func (a *Properties) validateAgentPoolProfiles() error {
if e := validatePoolOSType(agentPoolProfile.OSType); e != nil {
return e
}
if agentPoolProfile.AcceleratedNetworkingEnabled != nil {
if e := validatePoolAcceleratedNetworking(agentPoolProfile.VMSize, *agentPoolProfile.AcceleratedNetworkingEnabled); e != nil {

if helpers.IsTrueBoolPointer(agentPoolProfile.AcceleratedNetworkingEnabled) {
if e := validatePoolAcceleratedNetworking(agentPoolProfile.VMSize); e != nil {
return e
}
}
Expand Down Expand Up @@ -1132,11 +1133,9 @@ func validatePoolOSType(os OSType) error {
return nil
}

func validatePoolAcceleratedNetworking(VMSize string, AcceleratedNetworking bool) error {
if AcceleratedNetworking {
if helpers.AcceleratedNetworkingSupported(VMSize) != AcceleratedNetworking {
return fmt.Errorf("The AgentPoolProfile.vmsize does not support AgentPoolProfile.acceleratedNetworking")
}
func validatePoolAcceleratedNetworking(VMSize string) error {
if !helpers.AcceleratedNetworkingSupported(VMSize) {
return fmt.Errorf("The AgentPoolProfile.vmsize does not support AgentPoolProfile.acceleratedNetworking")
}
return nil
}
Expand Down

0 comments on commit 3a13d1b

Please sign in to comment.