From 4aae530b03cdeb3c3fa424a1e4bbf7ea1ddbf9e5 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Sat, 24 Oct 2020 09:02:41 +0200 Subject: [PATCH 1/2] Fix circular dependency in tasks related to kubelet serving cert --- nodeup/pkg/model/kubelet.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nodeup/pkg/model/kubelet.go b/nodeup/pkg/model/kubelet.go index caad3c40c49c1..09abae92813a8 100644 --- a/nodeup/pkg/model/kubelet.go +++ b/nodeup/pkg/model/kubelet.go @@ -566,17 +566,19 @@ func (b *KubeletBuilder) buildKubeletServingCertificate(c *fi.ModelBuilderContex cert, key := b.GetBootstrapCert(name) c.AddTask(&nodetasks.File{ - Path: filepath.Join(dir, name+".crt"), - Contents: cert, - Type: nodetasks.FileType_File, - Mode: fi.String("0644"), + Path: filepath.Join(dir, name+".crt"), + Contents: cert, + Type: nodetasks.FileType_File, + Mode: fi.String("0644"), + BeforeServices: []string{"kubelet.service"}, }) c.AddTask(&nodetasks.File{ - Path: filepath.Join(dir, name+".key"), - Contents: key, - Type: nodetasks.FileType_File, - Mode: fi.String("0400"), + Path: filepath.Join(dir, name+".key"), + Contents: key, + Type: nodetasks.FileType_File, + Mode: fi.String("0400"), + BeforeServices: []string{"kubelet.service"}, }) } else { From 879b445ec141037217a957b404b80a6ea88368b3 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Sat, 24 Oct 2020 09:27:15 +0200 Subject: [PATCH 2/2] Fix circular dependency in tasks related to cilium certs --- nodeup/pkg/model/networking/cilium.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nodeup/pkg/model/networking/cilium.go b/nodeup/pkg/model/networking/cilium.go index 8739139dbf2f3..6289b5d4e6a23 100644 --- a/nodeup/pkg/model/networking/cilium.go +++ b/nodeup/pkg/model/networking/cilium.go @@ -131,17 +131,19 @@ func (b *CiliumBuilder) buildCiliumEtcdSecrets(c *fi.ModelBuilderContext) error cert, key := b.GetBootstrapCert(name) c.AddTask(&nodetasks.File{ - Path: filepath.Join(dir, name+".crt"), - Contents: cert, - Type: nodetasks.FileType_File, - Mode: fi.String("0644"), + Path: filepath.Join(dir, name+".crt"), + Contents: cert, + Type: nodetasks.FileType_File, + Mode: fi.String("0644"), + BeforeServices: []string{"kubelet.service"}, }) c.AddTask(&nodetasks.File{ - Path: filepath.Join(dir, name+".key"), - Contents: key, - Type: nodetasks.FileType_File, - Mode: fi.String("0400"), + Path: filepath.Join(dir, name+".key"), + Contents: key, + Type: nodetasks.FileType_File, + Mode: fi.String("0400"), + BeforeServices: []string{"kubelet.service"}, }) return b.BuildCertificateTask(c, signer, filepath.Join(dir, "etcd-ca.crt"), nil)