MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / GetProvisioner

Function GetProvisioner

pkg/provision/storage/provisioner.go:49–68  ·  view source on GitHub ↗

GetProvisioner returns the storage provisioner that should be used for the current workspace

(workspace *common.DevWorkspaceWithConfig)

Source from the content-addressed store, hash-verified

47
48// GetProvisioner returns the storage provisioner that should be used for the current workspace
49func GetProvisioner(workspace *common.DevWorkspaceWithConfig) (Provisioner, error) {
50 storageClass := workspace.Spec.Template.Attributes.GetString(constants.DevWorkspaceStorageTypeAttribute, nil)
51 if storageClass == "" {
52 return &CommonStorageProvisioner{}, nil
53 }
54 switch storageClass {
55 case constants.CommonStorageClassType:
56 return &CommonStorageProvisioner{}, nil
57 case constants.PerWorkspaceStorageClassType:
58 return &PerWorkspaceStorageProvisioner{}, nil
59 case constants.AsyncStorageClassType:
60 return &AsyncStorageProvisioner{}, nil
61 case constants.EphemeralStorageClassType:
62 return &EphemeralStorageProvisioner{}, nil
63 case constants.PerUserStorageClassType:
64 return &CommonStorageProvisioner{}, nil
65 default:
66 return nil, UnsupportedStorageStrategy
67 }
68}

Callers 4

ReconcileMethod · 0.92
finalizeStorageMethod · 0.92
GetWorkspacePVCInfoFunction · 0.92

Calls 1

GetStringMethod · 0.80