Skip to content

Commit

Permalink
pkg/imagebuilder: expose BuiltInBuildArgs for downstream
Browse files Browse the repository at this point in the history
Expose map BuiltInBuildArgs so downstream users like buildah can use it.

Signed-off-by: Aditya R <[email protected]>
  • Loading branch information
flouthoc committed Jun 16, 2023
1 parent bf1ff5c commit ff5f1ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dispatchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/containers/storage/pkg/regexp"
"github.com/openshift/imagebuilder/signal"
"github.com/openshift/imagebuilder/strslice"
"golang.org/x/exp/maps"
)

var (
Expand All @@ -42,6 +43,11 @@ var builtinBuildArgs = map[string]string{
"BUILDVARIANT": localspec.Variant,
}

// Exposes map of global built-in args with their respective populated values.
func GetBuiltinBuildArgs() map[string]string {
return maps.Clone(builtinBuildArgs)
}

func init() {
if localspec.Variant != "" {
builtinBuildArgs["TARGETPLATFORM"] = builtinBuildArgs["TARGETPLATFORM"] + "/" + localspec.Variant
Expand Down

0 comments on commit ff5f1ae

Please sign in to comment.