You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-11-06 09:09:19 +02:00
feat(jenkins): update jenkins go dependency (#2848)
* update dependency * use context * regenerate mock * decapitalize error messages * use getBuildFromQueueID * add comments about mockery * update mocks * update tests * add context parameter * pull up context * update mocks * update tests
This commit is contained in:
committed by
GitHub
parent
19b9efc4ee
commit
40c32598a4
@@ -1,6 +1,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -101,14 +102,15 @@ func runVaultRotateSecretID(utils vaultRotateSecretIDUtils) error {
|
||||
func writeVaultSecretIDToStore(config *vaultRotateSecretIdOptions, secretID string) error {
|
||||
switch config.SecretStore {
|
||||
case "jenkins":
|
||||
instance, err := jenkins.Instance(&http.Client{}, config.JenkinsURL, config.JenkinsUsername, config.JenkinsToken)
|
||||
ctx := context.Background()
|
||||
instance, err := jenkins.Instance(ctx, &http.Client{}, config.JenkinsURL, config.JenkinsUsername, config.JenkinsToken)
|
||||
if err != nil {
|
||||
log.Entry().Warn("Could not write secret ID back to jenkins")
|
||||
return err
|
||||
}
|
||||
credManager := jenkins.NewCredentialsManager(instance)
|
||||
credential := jenkins.StringCredentials{ID: config.VaultAppRoleSecretTokenCredentialsID, Secret: secretID}
|
||||
return jenkins.UpdateCredential(credManager, config.JenkinsCredentialDomain, credential)
|
||||
return jenkins.UpdateCredential(ctx, credManager, config.JenkinsCredentialDomain, credential)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user