From f925db2a322756f11687d91d0e75d3571a012629 Mon Sep 17 00:00:00 2001 From: Kimmo Lehto Date: Mon, 11 Apr 2022 11:19:58 +0300 Subject: [PATCH] Fix double binary upload/download (#371) --- phase/download_k0s.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/phase/download_k0s.go b/phase/download_k0s.go index 5a596055..cf498293 100644 --- a/phase/download_k0s.go +++ b/phase/download_k0s.go @@ -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 }