test
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user