Skip to content

Commit

Permalink
feat(google): permit guest accelerator config for regional server gro…
Browse files Browse the repository at this point in the history
…ups with zones explicitly selected
  • Loading branch information
plumpy authored and maggieneterval committed Oct 15, 2019
1 parent 86f6536 commit 7c4b5b3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import groovy.util.logging.Slf4j
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component

import static com.google.common.base.Preconditions.checkArgument
import static com.netflix.spinnaker.clouddriver.google.deploy.GCEUtil.BACKEND_SERVICE_NAMES
import static com.netflix.spinnaker.clouddriver.google.deploy.GCEUtil.GLOBAL_LOAD_BALANCER_NAMES
import static com.netflix.spinnaker.clouddriver.google.deploy.GCEUtil.LOAD_BALANCING_POLICY
Expand Down Expand Up @@ -395,11 +396,14 @@ class BasicGoogleDeployHandler implements DeployHandler<BasicGoogleDeployDescrip
namer.applyMoniker(new GoogleInstanceTemplate(labels: labels), moniker)

// Accelerators are supported for zonal server groups only.
List<AcceleratorConfig> acceleratorConfigs = description.regional ? [] : description.acceleratorConfigs
if (description.acceleratorConfigs) {
checkArgument(!description.regional || description.selectZones,
"Accelerators are only supported with regional server groups if the zones are specified by the user.");
}

def instanceProperties = new InstanceProperties(machineType: machineTypeName,
disks: attachedDisks,
guestAccelerators: acceleratorConfigs ?: [],
guestAccelerators: description.acceleratorConfigs ?: [],
networkInterfaces: [networkInterface],
canIpForward: canIpForward,
metadata: metadata,
Expand Down

0 comments on commit 7c4b5b3

Please sign in to comment.