mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(registry): sync config on change [EE-5460] (#8955)
This commit is contained in:
parent
d803d5f821
commit
61b568a738
4 changed files with 36 additions and 16 deletions
|
@ -140,6 +140,8 @@ func (handler *Handler) registryUpdate(w http.ResponseWriter, r *http.Request) *
|
|||
}
|
||||
}
|
||||
|
||||
registry.ManagementConfiguration = syncConfig(registry)
|
||||
|
||||
if payload.URL != nil {
|
||||
shouldUpdateSecrets = shouldUpdateSecrets || (*payload.URL != registry.URL)
|
||||
|
||||
|
@ -183,6 +185,21 @@ func (handler *Handler) registryUpdate(w http.ResponseWriter, r *http.Request) *
|
|||
return response.JSON(w, registry)
|
||||
}
|
||||
|
||||
func syncConfig(registry *portainer.Registry) *portainer.RegistryManagementConfiguration {
|
||||
config := registry.ManagementConfiguration
|
||||
if config == nil {
|
||||
config = &portainer.RegistryManagementConfiguration{}
|
||||
}
|
||||
|
||||
config.Authentication = registry.Authentication
|
||||
config.Username = registry.Username
|
||||
config.Password = registry.Password
|
||||
config.Ecr = registry.Ecr
|
||||
config.Type = registry.Type
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
func (handler *Handler) updateEndpointRegistryAccess(endpoint *portainer.Endpoint, registry *portainer.Registry, endpointAccess portainer.RegistryAccessPolicies) error {
|
||||
|
||||
cli, err := handler.K8sClientFactory.GetKubeClient(endpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue