diff --git a/pkg/provision/config/config.go b/pkg/provision/config/config.go index 6951e75b2..371b7402a 100644 --- a/pkg/provision/config/config.go +++ b/pkg/provision/config/config.go @@ -30,11 +30,13 @@ import ( ) const ( - commonPVCSizeKey = "commonPVCSize" + commonPVCSizeKey = "commonPVCSize" + perWorkspacePVCSizeKey = "perWorkspacePVCSize" ) type NamespacedConfig struct { - CommonPVCSize string + CommonPVCSize string + PerWorkspacePVCSize string } // ReadNamespacedConfig reads the per-namespace DevWorkspace configmap and returns it as a struct. If there are @@ -71,7 +73,8 @@ func ReadNamespacedConfig(namespace string, api sync.ClusterAPI) (*NamespacedCon } return &NamespacedConfig{ - CommonPVCSize: cm.Data[commonPVCSizeKey], + CommonPVCSize: cm.Data[commonPVCSizeKey], + PerWorkspacePVCSize: cm.Data[perWorkspacePVCSizeKey], }, nil } diff --git a/pkg/provision/storage/perWorkspaceStorage.go b/pkg/provision/storage/perWorkspaceStorage.go index 480328134..7069712fb 100644 --- a/pkg/provision/storage/perWorkspaceStorage.go +++ b/pkg/provision/storage/perWorkspaceStorage.go @@ -158,8 +158,8 @@ func syncPerWorkspacePVC(workspace *dw.DevWorkspace, clusterAPI sync.ClusterAPI) // TODO: Determine the storage size that is needed by iterating through workspace volumes, // adding the sizes specified and figuring out overrides/defaults pvcSize := constants.PVCStorageSize - if namespacedConfig != nil && namespacedConfig.CommonPVCSize != "" { - pvcSize = namespacedConfig.CommonPVCSize + if namespacedConfig != nil && namespacedConfig.PerWorkspacePVCSize != "" { + pvcSize = namespacedConfig.PerWorkspacePVCSize } pvc, err := getPVCSpec(common.PerWorkspacePVCName(workspace.Status.DevWorkspaceId), workspace.Namespace, pvcSize)