Skip to content

Commit

Permalink
Merge branch 'use_device_plugin_toleration' into 'master'
Browse files Browse the repository at this point in the history
Apply device-plugin toleration, affinity, nodeSelector settings to device-plugin-validation too

See merge request nvidia/kubernetes/gpu-operator!185
  • Loading branch information
shivamerla committed Feb 24, 2021
2 parents 7d3f8ba + 34cc777 commit e1cba98
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/controller/clusterpolicy/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,19 @@ func TransformDevicePluginValidator(obj *v1.Pod, config *gpuv1.ClusterPolicySpec
}
}

// set node selector if specified for device-plugin
if len(config.DevicePlugin.NodeSelector) > 0 {
obj.Spec.NodeSelector = config.DevicePlugin.NodeSelector
}
// set node affinity if specified for device-plugin
if config.DevicePlugin.Affinity != nil {
obj.Spec.Affinity = config.DevicePlugin.Affinity
}
// set tolerations if specified for device-plugin
if len(config.DevicePlugin.Tolerations) > 0 {
obj.Spec.Tolerations = config.DevicePlugin.Tolerations
}

return nil
}

Expand Down

0 comments on commit e1cba98

Please sign in to comment.