diff --git a/dispatchers.go b/dispatchers.go index f264876c..63e9cb0b 100644 --- a/dispatchers.go +++ b/dispatchers.go @@ -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 ( @@ -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 diff --git a/go.mod b/go.mod index 37f9dea1..857eed6a 100644 --- a/go.mod +++ b/go.mod @@ -38,6 +38,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect golang.org/x/mod v0.9.0 // indirect golang.org/x/sys v0.7.0 // indirect golang.org/x/tools v0.7.0 // indirect diff --git a/go.sum b/go.sum index f07151ca..2bfce774 100644 --- a/go.sum +++ b/go.sum @@ -115,6 +115,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=