Skip to content

Commit

Permalink
fix(buildargs): initialize buildargs as map if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
tunahanertekin committed May 18, 2023
1 parent d88e49f commit f75a30a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pipelines/freecad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ steps:
baseStep: "xfce-withuser"
path: "dockerfiles/freecad"
dockerfile: "Dockerfile.freecad"
buildArgs:
"FREECAD_VERSION": "0.18.4+dfsg2-1ubuntu4"
push: false
7 changes: 7 additions & 0 deletions pkg/api/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Step struct {
func (step *Step) Default(lc LaunchConfig) {
step.setImageName(lc)
step.setContext(lc)
step.setBuildArgs(lc)
step.setBaseImage(lc)
}

Expand All @@ -40,6 +41,12 @@ func (step *Step) setContext(lc LaunchConfig) {
}
}

func (step *Step) setBuildArgs(lc LaunchConfig) {
if len(step.BuildArgs) == 0 {
step.BuildArgs = make(map[string]*string)
}
}

func (step *Step) setBaseImage(lc LaunchConfig) {
if _, ok := step.BuildArgs["base_image"]; !ok {
baseStep, _ := step.GetBaseStep(lc)
Expand Down

0 comments on commit f75a30a

Please sign in to comment.