This commit is contained in:
mr
2026-06-23 09:40:33 +02:00
parent 58e97fbe74
commit 3a66b42c01
8 changed files with 476 additions and 38 deletions
+32 -1
View File
@@ -115,7 +115,38 @@ func (r *WorkspaceResourceSet) Fill(request *tools.APIRequest) {
}
}
for _, d := range r.DynamicResources {
d.SetAllowedInstances(request)
var candidates []ResourceInterface
switch d.Type {
case tools.COMPUTE_RESOURCE:
for _, c := range r.ComputeResources {
candidates = append(candidates, c)
}
case tools.DATA_RESOURCE:
for _, c := range r.DataResources {
candidates = append(candidates, c)
}
case tools.STORAGE_RESOURCE:
for _, c := range r.StorageResources {
candidates = append(candidates, c)
}
case tools.PROCESSING_RESOURCE:
for _, c := range r.ProcessingResources {
candidates = append(candidates, c)
}
case tools.WORKFLOW_RESOURCE:
for _, c := range r.WorkflowResources {
candidates = append(candidates, c)
}
case tools.SERVICE_RESOURCE:
for _, c := range r.ServiceResources {
candidates = append(candidates, c)
}
}
if len(candidates) > 0 {
d.SetAllowedInstancesFromSet(candidates, request)
} else {
d.SetAllowedInstances(request)
}
}
}