Update channels before setting labels

This will prevent an old kops-controller pod from being scheduled to the new master.
This commit is contained in:
Ole Markus With 2021-09-25 09:11:32 +02:00
parent e7a5437a34
commit d1ff1090a3
1 changed files with 5 additions and 5 deletions

View File

@ -88,16 +88,16 @@ func (k *KubeBoot) RunSyncLoop() {
func (k *KubeBoot) syncOnce(ctx context.Context) error { func (k *KubeBoot) syncOnce(ctx context.Context) error {
if k.Master { if k.Master {
if k.BootstrapMasterNodeLabels {
if err := bootstrapMasterNodeLabels(ctx, k.Kubernetes, k.NodeName); err != nil {
klog.Warningf("error bootstrapping master node labels: %v", err)
}
}
for _, channel := range k.Channels { for _, channel := range k.Channels {
if err := applyChannel(channel); err != nil { if err := applyChannel(channel); err != nil {
klog.Warningf("error applying channel %q: %v", channel, err) klog.Warningf("error applying channel %q: %v", channel, err)
} }
} }
if k.BootstrapMasterNodeLabels {
if err := bootstrapMasterNodeLabels(ctx, k.Kubernetes, k.NodeName); err != nil {
klog.Warningf("error bootstrapping master node labels: %v", err)
}
}
} }
return nil return nil