Skip to content

Commit

Permalink
[CI-11703]: Fix image pull policy enums (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavharness authored May 23, 2024
1 parent c6b9be5 commit 49eca12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions engine/spec/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ func (p PullPolicy) String() string {

var pullPolicyID = map[PullPolicy]string{
PullDefault: "default",
PullAlways: "always",
PullIfNotExists: "if-not-exists",
PullNever: "never",
PullAlways: "Always",
PullIfNotExists: "IfNotPresent",
PullNever: "Never",
}

var pullPolicyName = map[string]PullPolicy{
"": PullDefault,
"default": PullDefault,
"always": PullAlways,
"if-not-exists": PullIfNotExists,
"never": PullNever,
"": PullDefault,
"default": PullDefault,
"Always": PullAlways,
"IfNotPresent": PullIfNotExists,
"Never": PullNever,
}

// MarshalJSON marshals the string representation of the
Expand Down
18 changes: 9 additions & 9 deletions engine/spec/const_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ func TestPullPolicy_Marshal(t *testing.T) {
}{
{
policy: PullAlways,
data: `"always"`,
data: `"Always"`,
},
{
policy: PullDefault,
data: `"default"`,
},
{
policy: PullIfNotExists,
data: `"if-not-exists"`,
data: `"IfNotPresent"`,
},
{
policy: PullNever,
data: `"never"`,
data: `"Never"`,
},
}
for _, test := range tests {
Expand All @@ -55,19 +55,19 @@ func TestPullPolicy_Unmarshal(t *testing.T) {
}{
{
policy: PullAlways,
data: `"always"`,
data: `"Always"`,
},
{
policy: PullDefault,
data: `"default"`,
},
{
policy: PullIfNotExists,
data: `"if-not-exists"`,
data: `"IfNotPresent"`,
},
{
policy: PullNever,
data: `"never"`,
data: `"Never"`,
},
{
// no policy should default to on-success
Expand Down Expand Up @@ -103,19 +103,19 @@ func TestPullPolicy_String(t *testing.T) {
}{
{
policy: PullAlways,
value: "always",
value: "Always",
},
{
policy: PullDefault,
value: "default",
},
{
policy: PullIfNotExists,
value: "if-not-exists",
value: "IfNotPresent",
},
{
policy: PullNever,
value: "never",
value: "Never",
},
}
for _, test := range tests {
Expand Down

0 comments on commit 49eca12

Please sign in to comment.