@@ -105,7 +105,8 @@ func rotateKey(account string, rotationCandidate rotationCandidate, creds cred.C
105
105
if newKeyID , newKey , err = createKey (account , key , keyProvider ); err != nil {
106
106
return
107
107
}
108
- if err = updateKeyLocation (account , rotationCandidate .keyLocation , newKeyID , newKey , keyProvider , creds ); err != nil {
108
+ keyWrapper := location.KeyWrapper {Key : newKey , KeyID : newKeyID , KeyProvider : keyProvider }
109
+ if err = updateKeyLocation (account , rotationCandidate .keyLocation , keyWrapper , creds ); err != nil {
109
110
return
110
111
}
111
112
return deleteKey (account , key , keyProvider )
@@ -237,7 +238,8 @@ func locationsToUpdate(keyLocation config.KeyLocations) (kws []location.KeyWrite
237
238
}
238
239
239
240
//updateKeyLocation updates locations specified in keyLocations with the new key, e.g. GitHub, CircleCI an K8s
240
- func updateKeyLocation (account string , keyLocations config.KeyLocations , keyID , key , keyProvider string , creds cred.Credentials ) (err error ) {
241
+ func updateKeyLocation (account string , keyLocations config.KeyLocations ,
242
+ keyWrapper location.KeyWrapper , creds cred.Credentials ) (err error ) {
241
243
242
244
// update locations
243
245
var updatedLocations []location.UpdatedLocation
@@ -246,7 +248,7 @@ func updateKeyLocation(account string, keyLocations config.KeyLocations, keyID,
246
248
247
249
var updated location.UpdatedLocation
248
250
249
- if updated , err = locationToUpdate .Write (keyLocations .ServiceAccountName , keyID , key , creds ); err != nil {
251
+ if updated , err = locationToUpdate .Write (keyLocations .ServiceAccountName , keyWrapper , creds ); err != nil {
250
252
return
251
253
}
252
254
@@ -255,9 +257,9 @@ func updateKeyLocation(account string, keyLocations config.KeyLocations, keyID,
255
257
256
258
// all done
257
259
logger .Infow ("Key locations updated" ,
258
- "keyProvider" , keyProvider ,
260
+ "keyProvider" , keyWrapper . KeyProvider ,
259
261
"account" , account ,
260
- "keyID" , keyID ,
262
+ "keyID" , keyWrapper . KeyID ,
261
263
"keyLocationUpdates" , updatedLocations )
262
264
263
265
return
0 commit comments