From c81e322986bb0e12255d8f2213a726dab29c3bcc Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Fri, 29 Sep 2023 13:59:56 +0200 Subject: [PATCH] fix(helm): forward sourceRepositoryCredentialsId from groovy to go layer (#4604) forward sourceRepositoryCredentialsId from groovy to go layer in the same way how this is done for the targetRepositoryCredentialsId --- cmd/helmExecute_generated.go | 3 ++- resources/metadata/helmExecute.yaml | 5 ++++- vars/helmExecute.groovy | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/helmExecute_generated.go b/cmd/helmExecute_generated.go index 516b471cbc..84a6c253a9 100644 --- a/cmd/helmExecute_generated.go +++ b/cmd/helmExecute_generated.go @@ -255,7 +255,8 @@ func helmExecuteMetadata() config.StepData { Secrets: []config.StepSecrets{ {Name: "kubeConfigFileCredentialsId", Description: "Jenkins 'Secret file' credentials ID containing kubeconfig file. Details can be found in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/).", Type: "jenkins", Aliases: []config.Alias{{Name: "kubeCredentialsId", Deprecated: true}}}, {Name: "dockerConfigJsonCredentialsId", Description: "Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)).", Type: "jenkins"}, - {Name: "targetRepositoryCredentialsId", Description: "Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication", Type: "jenkins"}, + {Name: "sourceRepositoryCredentialsId", Description: "Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication (source repo)", Type: "jenkins"}, + {Name: "targetRepositoryCredentialsId", Description: "Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication (target repo)", Type: "jenkins"}, }, Resources: []config.StepResources{ {Name: "deployDescriptor", Type: "stash"}, diff --git a/resources/metadata/helmExecute.yaml b/resources/metadata/helmExecute.yaml index f91c755a78..ccae717d7f 100644 --- a/resources/metadata/helmExecute.yaml +++ b/resources/metadata/helmExecute.yaml @@ -36,8 +36,11 @@ spec: - name: dockerConfigJsonCredentialsId description: Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)). type: jenkins + - name: sourceRepositoryCredentialsId + description: Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication (source repo) + type: jenkins - name: targetRepositoryCredentialsId - description: Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication + description: Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication (target repo) type: jenkins resources: - name: deployDescriptor diff --git a/vars/helmExecute.groovy b/vars/helmExecute.groovy index ef729cd237..89c8ee202a 100644 --- a/vars/helmExecute.groovy +++ b/vars/helmExecute.groovy @@ -7,6 +7,7 @@ void call(Map parameters = [:]) { List credentials = [ [type: 'file', id: 'kubeConfigFileCredentialsId', env: ['PIPER_kubeConfig']], [type: 'file', id: 'dockerConfigJsonCredentialsId', env: ['PIPER_dockerConfigJSON']], + [type: 'usernamePassword', id: 'sourceRepositoryCredentialsId', env: ['PIPER_sourceRepositoryUser', 'PIPER_sourceRepositoryPassword']], [type: 'usernamePassword', id: 'targetRepositoryCredentialsId', env: ['PIPER_targetRepositoryUser', 'PIPER_targetRepositoryPassword']], ] piperExecuteBin(parameters, STEP_NAME, METADATA_FILE, credentials)