Skip to content

Commit 8f8117e

Browse files
authored
Merge branch 'master' into patch-2
2 parents dae2656 + 5ddb244 commit 8f8117e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/controller/queuejobresources/genericresource/genericresource.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,12 @@ func hasFields(obj runtime.RawExtension) (hasFields bool, replica float64, conta
265265
unstruct.Object = blob.(map[string]interface{})
266266
spec, isFound, _ := unstructured.NestedMap(unstruct.UnstructuredContent(), "spec")
267267
replicas, isFound, _ := unstructured.NestedFloat64(spec, "replicas")
268+
269+
// Set default to 1 if no replicas field is found.
268270
if !isFound {
269-
return false, 0, nil
271+
replicas = 1
270272
}
273+
271274
template, isFound, _ := unstructured.NestedMap(spec, "template")
272275
subspec, isFound, _ := unstructured.NestedMap(template, "spec")
273276
containerList, isFound, _ := unstructured.NestedSlice(subspec, "containers")

0 commit comments

Comments
 (0)