File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
internal/namespaces/instance/v1 Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ func addDefaultVolumes(
375375 needScratch := false
376376 hasScratch := false
377377 defaultVolumes := []* instance.VolumeServerTemplate (nil )
378- if serverType . ScratchStorageMaxSize != nil && * serverType . ScratchStorageMaxSize > 0 {
378+ if shouldHaveScratchVolume ( serverType ) {
379379 needScratch = true
380380 }
381381 for _ , volume := range volumes {
@@ -411,6 +411,12 @@ func addDefaultVolumes(
411411 return volumes
412412}
413413
414+ func shouldHaveScratchVolume (serverType * instance.ServerType ) bool {
415+ return serverType .ScratchStorageMaxSize != nil &&
416+ * serverType .ScratchStorageMaxSize > 0 &&
417+ * serverType .Gpu > 0
418+ }
419+
414420func validateImageServerTypeCompatibility (
415421 image * instance.Image ,
416422 serverType * instance.ServerType ,
You can’t perform that action at this time.
0 commit comments