diff --git a/.github/actions/image-builder/action.yml b/.github/actions/image-builder/action.yml index d3ced100733e..f0139195b248 100644 --- a/.github/actions/image-builder/action.yml +++ b/.github/actions/image-builder/action.yml @@ -85,4 +85,4 @@ runs: - uses: docker://europe-docker.pkg.dev/kyma-project/prod/image-builder:v20241112-fd0d9381 id: build with: - args: --name=${{ inputs.image-name }} --context=${{ inputs.context }} --dockerfile=${{ inputs.dockerfile }} --azure-access-token=${{ inputs.ado-token }} --oidc-token=${{ inputs.oidc-token }} ${{ steps.prepare-build-args.outputs.build-args }} ${{ steps.prepare-tags.outputs.tags }} --export-tags=${{ inputs.export-tags }} --config=${{ inputs.config }} --env-file=${{ inputs.env-file }} --build-in-ado=true --use-go-internal-modules=${{ inputs.use-go-internal-sap-modules }} \ No newline at end of file + args: --name=${{ inputs.image-name }} --context=${{ inputs.context }} --dockerfile=${{ inputs.dockerfile }} --azure-access-token=${{ inputs.ado-token }} --oidc-token=${{ inputs.oidc-token }} ${{ steps.prepare-build-args.outputs.build-args }} ${{ steps.prepare-tags.outputs.tags }} --export-tags=${{ inputs.export-tags }} --config=${{ inputs.config }} --env-file=${{ inputs.env-file }} --build-in-ado=true --use-go-internal-sap-modules=${{ inputs.use-go-internal-sap-modules }} \ No newline at end of file diff --git a/cmd/image-builder/main.go b/cmd/image-builder/main.go index db8a692c9acc..206dbe619656 100644 --- a/cmd/image-builder/main.go +++ b/cmd/image-builder/main.go @@ -51,20 +51,20 @@ type options struct { platforms sets.Strings exportTags bool // signOnly only sign images. No build will be performed. - signOnly bool - imagesToSign sets.Strings - buildInADO bool - adoPreviewRun bool - adoPreviewRunYamlPath string - parseTagsOnly bool - oidcToken string - azureAccessToken string - ciSystem CISystem - gitState GitStateConfig - debug bool - dryRun bool - tagsOutputFile string - useGoInternalModules bool + signOnly bool + imagesToSign sets.Strings + buildInADO bool + adoPreviewRun bool + adoPreviewRunYamlPath string + parseTagsOnly bool + oidcToken string + azureAccessToken string + ciSystem CISystem + gitState GitStateConfig + debug bool + dryRun bool + tagsOutputFile string + useGoInternalSAPModules bool } type Logger interface { @@ -257,8 +257,8 @@ func prepareADOTemplateParameters(options options) (adopipelines.OCIImageBuilder templateParameters.SetAuthorization(options.oidcToken) } - if options.useGoInternalModules { - templateParameters.SetUseGoInternalModules() + if options.useGoInternalSAPModules { + templateParameters.SetUseGoInternalSAPModules() } err := templateParameters.Validate() @@ -838,7 +838,7 @@ func (o *options) gatherOptions(flagSet *flag.FlagSet) *flag.FlagSet { flagSet.StringVar(&o.oidcToken, "oidc-token", "", "Token used to authenticate against Azure DevOps backend service") flagSet.StringVar(&o.azureAccessToken, "azure-access-token", "", "Token used to authenticate against Azure DevOps API") flagSet.StringVar(&o.tagsOutputFile, "tags-output-file", "/generated-tags.json", "Path to file where generated tags will be written as JSON") - flagSet.BoolVar(&o.useGoInternalModules, "use-go-internal-modules", false, "Allow access to Go internal modules in ADO backend") + flagSet.BoolVar(&o.useGoInternalSAPModules, "use-go-interna-sap-modules", false, "Allow access to Go internal modules in ADO backend") return flagSet } diff --git a/pkg/azuredevops/pipelines/templatesParams.go b/pkg/azuredevops/pipelines/templatesParams.go index e99d8f7dd3c2..9f9d0cb37e51 100644 --- a/pkg/azuredevops/pipelines/templatesParams.go +++ b/pkg/azuredevops/pipelines/templatesParams.go @@ -138,11 +138,11 @@ func (p OCIImageBuilderTemplateParams) SetAuthorization(authorizationToken strin p["Authorization"] = authorizationToken } -// SetUseGoInternalModules sets UseGoInternalModules parameter. +// SetUseGoInternalSAPModules sets UseGoInternalModules parameter. // This parameter is used to setup access to internal Go modules. // Modules are fetched with go mod vendor command. -func (p OCIImageBuilderTemplateParams) SetUseGoInternalModules() { - p["UseGoInternalModules"] = "true" +func (p OCIImageBuilderTemplateParams) SetUseGoInternalSAPModules() { + p["UseGoInternalSAPModules"] = "true" } // Validate validates if required OCIImageBuilderTemplateParams are set. diff --git a/pkg/azuredevops/pipelines/templatesParams_test.go b/pkg/azuredevops/pipelines/templatesParams_test.go index 344ea5d5d6f6..409f9904dede 100644 --- a/pkg/azuredevops/pipelines/templatesParams_test.go +++ b/pkg/azuredevops/pipelines/templatesParams_test.go @@ -92,9 +92,9 @@ var _ = Describe("Test OCIImageBuilderTemplateParams", func() { Expect(params["Authorization"]).To(Equal("some-token")) }) - It("sets the correct useGoInternalModules", func() { - params.SetUseGoInternalModules() - Expect(params["UseGoInternalModules"]).To(Equal("true")) + It("sets the correct UseGoInternalSAPModules", func() { + params.SetUseGoInternalSAPModules() + Expect(params["UseGoInternalSAPModules"]).To(Equal("true")) }) // TODO: Improve assertions with more specific matchers and values.