diff --git a/pkg/config-reader/update.go b/pkg/config-reader/update.go index 69467eead..b6a3b16d0 100644 --- a/pkg/config-reader/update.go +++ b/pkg/config-reader/update.go @@ -63,11 +63,15 @@ func (r *ConfigReaderImpl) readImportsToUpdate(configFilePath string, cfg *aqua. sort.Strings(filePaths) for _, filePath := range filePaths { subCfg := &aqua.Config{} - if err := r.Read(filePath, subCfg); err != nil { + subCfgs, err := r.ReadToUpdate(filePath, subCfg) + if err != nil { return nil, err } subCfg.Registries = cfg.Registries cfgs[filePath] = subCfg + for k, subCfg := range subCfgs { + cfgs[k] = subCfg + } } } cfg.Packages = pkgs diff --git a/pkg/config-reader/update_test.go b/pkg/config-reader/update_test.go index 48f529215..de4b12a4c 100644 --- a/pkg/config-reader/update_test.go +++ b/pkg/config-reader/update_test.go @@ -137,10 +137,10 @@ packages: t.Fatal("error must be returned") } if diff := cmp.Diff(d.cfg, cfg); diff != "" { - t.Fatal(diff) + t.Fatal("cfg:", diff) } if diff := cmp.Diff(d.cfgs, cfgs); diff != "" { - t.Fatal(diff) + t.Fatal("cfgs:", diff) } }) } diff --git a/pkg/controller/update/registry.go b/pkg/controller/update/registry.go index 53784dc1f..0bc3f69f7 100644 --- a/pkg/controller/update/registry.go +++ b/pkg/controller/update/registry.go @@ -30,6 +30,10 @@ func (c *Controller) updateRegistries(ctx context.Context, logE *logrus.Entry, c for _, rgst := range cfg.Registries { if commitHashPattern.MatchString(rgst.Ref) { // Skip updating commit hashes + logE.WithFields(logrus.Fields{ + "registry_name": rgst.Name, + "registry_version": rgst.Ref, + }).Debug("skip a registry whose version is a commit hash") continue } newVersion, err := c.newRegistryVersion(ctx, logE, rgst)