diff --git a/pkg/templater/repo-apk.go b/pkg/templater/repo-apk.go index 35f3656..8b3b1d8 100644 --- a/pkg/templater/repo-apk.go +++ b/pkg/templater/repo-apk.go @@ -70,7 +70,6 @@ func (hr *APKRepository) Update() error { if _, stdErr, err := utils.RunSystemCommand("apk", "update"); err != nil { return fmt.Errorf("%s [%s]", stdErr, err) } - return nil } @@ -88,7 +87,10 @@ func (hr *APKRepository) Delete() error { func (hr *APKRepository) Manage() error { if hr.Enabled { - return hr.Add() + if err := hr.Add(); err != nil { + return err + } + return hr.Update() } else { return hr.Delete() } diff --git a/pkg/templater/services.go b/pkg/templater/services.go index 7d58597..68f6f18 100644 --- a/pkg/templater/services.go +++ b/pkg/templater/services.go @@ -19,15 +19,21 @@ func (s *Service) manageRepos(repos map[string]Repository) error { for _, repo := range s.Repos { if repo.Type == "helm" { rp := HelmRepository{repo} - return rp.Manage() + if err := rp.Manage(); err != nil { + return err + } } if repo.Type == "apk" { rp := APKRepository{repo} - return rp.Manage() + if err := rp.Manage(); err != nil { + return err + } } if repo.Type == "deb" { rp := DebRepository{} - return rp.Manage() + if err := rp.Manage(); err != nil { + return err + } } }