mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
chore(loops): remove loop var copy EE-7342 (#12023)
This commit is contained in:
parent
6e7a42727a
commit
7fd1a644a6
7 changed files with 61 additions and 48 deletions
|
@ -42,7 +42,6 @@ func createRegistryAuthenticationHeader(
|
|||
var matchingRegistry *portainer.Registry
|
||||
|
||||
for _, registry := range accessContext.registries {
|
||||
registry := registry
|
||||
if registry.ID == registryID &&
|
||||
(accessContext.isAdmin ||
|
||||
security.AuthorizedRegistryAccess(®istry, accessContext.user, accessContext.teamMemberships, accessContext.endpointID)) {
|
||||
|
@ -52,14 +51,16 @@ func createRegistryAuthenticationHeader(
|
|||
}
|
||||
}
|
||||
|
||||
if matchingRegistry != nil {
|
||||
if err = registryutils.EnsureRegTokenValid(dataStore, matchingRegistry); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
authenticationHeader.Serveraddress = matchingRegistry.URL
|
||||
authenticationHeader.Username, authenticationHeader.Password, err = registryutils.GetRegEffectiveCredential(matchingRegistry)
|
||||
if matchingRegistry == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = registryutils.EnsureRegTokenValid(dataStore, matchingRegistry); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
authenticationHeader.Serveraddress = matchingRegistry.URL
|
||||
authenticationHeader.Username, authenticationHeader.Password, err = registryutils.GetRegEffectiveCredential(matchingRegistry)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue