versions: designate components for upgrades

This commit is contained in:
Markus Rudy 2023-12-14 16:02:59 +01:00 committed by Markus Rudy
parent 7c5b95bbcc
commit b740a1a75b
2 changed files with 51 additions and 0 deletions

View file

@ -83,3 +83,14 @@ func (c Components) GetKubeadmComponent() (*Component, error) {
}
return nil, errors.New("kubeadm component not found")
}
// GetUpgradableComponents returns only those Components that should be passed to the upgrade-agent.
func (c Components) GetUpgradableComponents() Components {
var cs Components
for _, c := range c {
if strings.HasPrefix(c.Url, "data:") || strings.HasSuffix(c.InstallPath, "kubeadm") {
cs = append(cs, c)
}
}
return cs
}