Merge pull request #2309 from galexrt/pvc_templates_storage_selection

Added PersistentVolumeClaimTemplates to storage selection
This commit is contained in:
Alexander Trost
2018-11-28 21:46:21 +01:00
committed by GitHub
2 changed files with 9 additions and 3 deletions
+5
View File
@@ -90,6 +90,10 @@ func (s *StorageScopeSpec) resolveNodeSelection(node *Node) {
if len(node.Selection.Directories) == 0 {
node.Selection.Directories = s.Directories
}
if len(node.Selection.VolumeClaimTemplates) == 0 {
node.Selection.VolumeClaimTemplates = s.VolumeClaimTemplates
}
}
func (s *StorageScopeSpec) resolveNodeConfig(node *Node) {
@@ -105,6 +109,7 @@ func (s *StorageScopeSpec) resolveNodeConfig(node *Node) {
}
}
// GetUseAllDevices return if all devices should be used.
func (s *Selection) GetUseAllDevices() bool {
return s.UseAllDevices != nil && *(s.UseAllDevices)
}
+4 -3
View File
@@ -60,13 +60,14 @@ type Directory struct {
type Selection struct {
// Whether to consume all the storage devices found on a machine
UseAllDevices *bool `json:"useAllDevices,omitempty"`
// A regular expression to allow more fine-grained selection of devices on nodes across the cluster
DeviceFilter string `json:"deviceFilter,omitempty"`
// List of devices to use as storage devices
Devices []Device `json:"devices,omitempty"`
// List of host directories to use as storage
Directories []Directory `json:"directories,omitempty"`
// PersistentVolumeClaims to use as storage
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
}
type PlacementSpec map[string]Placement