1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-28 05:47:08 +02:00

feat(hadolint): allow config secret from vault (#3353)

* allow config secret from vault

* add credential alias

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
This commit is contained in:
Christopher Fenner 2021-12-14 13:42:06 +01:00 committed by GitHub
parent 1395f01758
commit 6f06ce0f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 6 deletions

View File

@ -158,11 +158,17 @@ func hadolintExecuteMetadata() config.StepData {
Param: "username",
Type: "secret",
},
{
Name: "hadolintConfigSecretName",
Type: "vaultSecret",
Default: "hadolintConfig",
},
},
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "username"}},
Default: os.Getenv("PIPER_configurationUsername"),
},
{
@ -173,11 +179,17 @@ func hadolintExecuteMetadata() config.StepData {
Param: "password",
Type: "secret",
},
{
Name: "hadolintConfigSecretName",
Type: "vaultSecret",
Default: "hadolintConfig",
},
},
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "password"}},
Default: os.Getenv("PIPER_configurationPassword"),
},
{

View File

@ -21,6 +21,8 @@ spec:
- STEPS
default: null
- name: configurationUsername
aliases:
- name: username
type: string
description: The username to authenticate
scope:
@ -29,10 +31,15 @@ spec:
- STEPS
secret: true
resourceRef:
- name: configurationCredentialsId
type: secret
- type: secret
name: configurationCredentialsId
param: username
- type: vaultSecret
name: hadolintConfigSecretName
default: hadolintConfig
- name: configurationPassword
aliases:
- name: password
type: string
description: The password to authenticate
scope:
@ -41,9 +48,12 @@ spec:
- STEPS
secret: true
resourceRef:
- name: configurationCredentialsId
type: secret
- type: secret
name: configurationCredentialsId
param: password
- type: vaultSecret
name: hadolintConfigSecretName
default: hadolintConfig
- name: dockerFile
aliases:
- name: dockerfile