Skip to content

Commit

Permalink
Fix double binary upload/download (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
kke committed Apr 11, 2022
1 parent 5e3d301 commit f925db2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion phase/download_k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ func (p *DownloadK0s) Title() string {
func (p *DownloadK0s) Prepare(config *v1beta1.Cluster) error {
p.Config = config
p.hosts = p.Config.Spec.Hosts.Filter(func(h *cluster.Host) bool {
return h.Metadata.K0sBinaryVersion != p.Config.Spec.K0s.Version && !h.Metadata.NeedsUpgrade
if h.Metadata.K0sBinaryVersion == p.Config.Spec.K0s.Version {
return false
}

if h.Metadata.NeedsUpgrade {
return false
}

if h.UploadBinary {
return false
}

return true
})
return nil
}
Expand Down

0 comments on commit f925db2

Please sign in to comment.