Skip to content

Commit

Permalink
update test examples per changes related to 'RegisterObj' task
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Shmulevich <[email protected]>
  • Loading branch information
dmitsh committed May 16, 2024
1 parent 7de87db commit 3d1ba6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
7 changes: 4 additions & 3 deletions pkg/engine/submit_object_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func TestNewSubmitObjTask(t *testing.T) {
},
},
},
"replicas": 2,
},
},
}
Expand Down Expand Up @@ -172,7 +173,7 @@ func TestNewSubmitObjTask(t *testing.T) {
},
Metadata: objectMeta{
Name: "job1",
Namespace: "test",
Namespace: "default",
},
Spec: spec,
},
Expand Down Expand Up @@ -215,7 +216,7 @@ func TestNewSubmitObjTask(t *testing.T) {
},
Metadata: objectMeta{
Name: "job1",
Namespace: "test",
Namespace: "default",
},
Spec: spec,
},
Expand All @@ -226,7 +227,7 @@ func TestNewSubmitObjTask(t *testing.T) {
},
Metadata: objectMeta{
Name: "job2",
Namespace: "test",
Namespace: "default",
},
Spec: spec,
},
Expand Down
3 changes: 2 additions & 1 deletion resources/templates/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: example.com/v1
kind: MyObject
metadata:
name: "{{._NAME_}}"
namespace: test
namespace: {{or .namespace "default"}}
spec:
runPolicy:
coScheduling: null
Expand All @@ -16,6 +16,7 @@ spec:
obj-name: test
instance: {{.instance}}
spec:
replicas: {{.replicas}}
containers:
- name: test
args:
Expand Down
20 changes: 12 additions & 8 deletions resources/tests/test-custom-resource.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: test-custom-resource
description: submit custom resource
tasks:
- id: register
type: RegisterObj
params:
template: "resources/templates/example.yml"
nameFormat: "job{{._ENUM_}}"
podNameFormat: "{{._NAME_}}-[0-9]+"
podCount: "{{.replicas}}"
- id: job
type: SubmitObj
params:
count: 1
grv:
group: example.com
version: v1
resource: myobjects
template: "resources/templates/example.yml"
overrides:
name: 1
refTaskId: register
count: 4
params:
namespace: test
replicas: 2
instance: lnx2000
command: "sleep infinity"
image: ubuntu
Expand Down

0 comments on commit 3d1ba6d

Please sign in to comment.