Skip to content

Commit

Permalink
add allowed values
Browse files Browse the repository at this point in the history
Signed-off-by: Filinto Duran <filinto@diagrid.io>
  • Loading branch information
filintod committed Nov 12, 2024
1 parent 448ecae commit e2f366e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/runfileconfig/run_file_config_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ func (a *RunFileConfig) validateRunConfig(runFilePath string) error {

// Check containerImagePullPolicy is valid

Check failure on line 101 in pkg/runfileconfig/run_file_config_parser.go

View workflow job for this annotation

GitHub Actions / Build linux_amd64 binaries

Comment should end in a period (godot)
if a.Apps[i].ContainerImagePullPolicy != "" {
if a.Apps[i].ContainerImagePullPolicy != "Always" && a.Apps[i].ContainerImagePullPolicy != "Never" && a.Apps[i].ContainerImagePullPolicy != "IfNotPresent" {
return fmt.Errorf("invalid containerImagePullPolicy: %s", a.Apps[i].ContainerImagePullPolicy)
allowedValues := []string{"Always", "Never", "IfNotPresent"}
if !utils.Contains(allowedValues, a.Apps[i].ContainerImagePullPolicy) {
return fmt.Errorf("invalid containerImagePullPolicy: %s, allowed values: %v", a.Apps[i].ContainerImagePullPolicy, allowedValues)
}
} else {
a.Apps[i].ContainerImagePullPolicy = "Always"
Expand Down

0 comments on commit e2f366e

Please sign in to comment.