@@ -130,7 +130,7 @@ func getCredsFromSecret(wbc *WriteBackConfig, credentialsSecret string, kubeClie
130
130
if sshPrivateKey , ok = credentials ["sshPrivateKey" ]; ! ok {
131
131
return nil , fmt .Errorf ("invalid secret %s: does not contain field sshPrivateKey" , credentialsSecret )
132
132
}
133
- return git .NewSSHCreds (string (sshPrivateKey ), "" , true , git. NoopCredsStore {} , "" ), nil
133
+ return git .NewSSHCreds (string (sshPrivateKey ), "" , true , wbc . GitCreds , "" ), nil
134
134
} else if git .IsHTTPSURL (wbc .GitRepo ) {
135
135
var username , password , githubAppID , githubAppInstallationID , githubAppPrivateKey []byte
136
136
if githubAppID , ok = credentials ["githubAppID" ]; ok {
@@ -149,12 +149,12 @@ func getCredsFromSecret(wbc *WriteBackConfig, credentialsSecret string, kubeClie
149
149
if err != nil {
150
150
return nil , fmt .Errorf ("invalid value in field githubAppInstallationID: %w" , err )
151
151
}
152
- return git .NewGitHubAppCreds (intGithubAppID , intGithubAppInstallationID , string (githubAppPrivateKey ), "" , "" , "" , "" , true , "" , git. NoopCredsStore {} ), nil
152
+ return git .NewGitHubAppCreds (intGithubAppID , intGithubAppInstallationID , string (githubAppPrivateKey ), "" , "" , "" , "" , true , "" , wbc . GitCreds ), nil
153
153
} else if username , ok = credentials ["username" ]; ok {
154
154
if password , ok = credentials ["password" ]; ! ok {
155
155
return nil , fmt .Errorf ("invalid secret %s: does not contain field password" , credentialsSecret )
156
156
}
157
- return git .NewHTTPSCreds (string (username ), string (password ), "" , "" , true , "" , git. NoopCredsStore {} , false ), nil
157
+ return git .NewHTTPSCreds (string (username ), string (password ), "" , "" , true , "" , wbc . GitCreds , false ), nil
158
158
}
159
159
return nil , fmt .Errorf ("invalid repository credentials in secret %s: does not contain githubAppID or username" , credentialsSecret )
160
160
}
0 commit comments