Skip to content

Commit 51bf79d

Browse files
authored
Add pullPolicy to run container model (#253)
Signed-off-by: Simon Emms <simon@simonemms.com>
1 parent a776b63 commit 51bf79d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

model/task_run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Container struct {
4646
Environment map[string]string `json:"environment,omitempty"`
4747
Input string `json:"stdin,omitempty"`
4848
Arguments []string `json:"arguments,omitempty"`
49+
PullPolicy string `json:"pullPolicy,omitempty" validate:"oneof=ifNotPresent always never"`
4950
Lifetime *ContainerLifetime `json:"lifetime,omitempty"`
5051
}
5152

model/task_run_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func TestRunTask_MarshalJSON(t *testing.T) {
5050
"arg1",
5151
"arg2",
5252
},
53+
PullPolicy: "always",
5354
Lifetime: &ContainerLifetime{
5455
Cleanup: "eventually",
5556
After: NewDurationExpr("20s"),
@@ -77,6 +78,7 @@ func TestRunTask_MarshalJSON(t *testing.T) {
7778
"environment": {"ENV_VAR": "value"},
7879
"stdin": "example-input",
7980
"arguments": ["arg1","arg2"],
81+
"pullPolicy": "always",
8082
"lifetime": {
8183
"cleanup": "eventually",
8284
"after": "20s"

0 commit comments

Comments
 (0)