Skip to content

Commit

Permalink
Merge pull request #45571 from thaJeztah/24.0_backport_fix_insecure_r…
Browse files Browse the repository at this point in the history
…egistries_reload

[24.0 backport] Fix insecure registries reload
  • Loading branch information
thaJeztah committed May 19, 2023
2 parents 922b6aa + 3467ba6 commit a0bc3eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daemon/reload.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ func (daemon *Daemon) Reload(conf *config.Config) (err error) {
if err := daemon.reloadAllowNondistributableArtifacts(conf, attributes); err != nil {
return err
}
if err := daemon.reloadInsecureRegistries(conf, attributes); err != nil {
if err := daemon.reloadRegistryMirrors(conf, attributes); err != nil {
return err
}
if err := daemon.reloadRegistryMirrors(conf, attributes); err != nil {
if err := daemon.reloadInsecureRegistries(conf, attributes); err != nil {
return err
}
if err := daemon.reloadLiveRestore(conf, attributes); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions daemon/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,19 @@ func TestDaemonReloadInsecureRegistries(t *testing.T) {
"docker3.example.com", // this will be newly added
}

mirrors := []string{
"https://mirror.test.example.com",
}

valuesSets := make(map[string]interface{})
valuesSets["insecure-registries"] = insecureRegistries
valuesSets["registry-mirrors"] = mirrors

newConfig := &config.Config{
CommonConfig: config.CommonConfig{
ServiceOptions: registry.ServiceOptions{
InsecureRegistries: insecureRegistries,
Mirrors: mirrors,
},
ValuesSet: valuesSets,
},
Expand Down

0 comments on commit a0bc3eb

Please sign in to comment.