From f4e3dd3e265081b55500b0840b160f45c952f189 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Mon, 16 Nov 2020 07:27:00 +0100 Subject: [PATCH] Rename NeedUpdate struct to NeedsRollingUpdate --- channels/pkg/api/channel.go | 4 ++-- channels/pkg/channels/addon.go | 6 +++--- upup/pkg/fi/cloudup/bootstrapchannelbuilder.go | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/channels/pkg/api/channel.go b/channels/pkg/api/channel.go index 120407fdfe..41e1a6397f 100644 --- a/channels/pkg/api/channel.go +++ b/channels/pkg/api/channel.go @@ -63,10 +63,10 @@ type AddonSpec struct { // switch kubernetes versions. Id string `json:"id,omitempty"` - // NeedUpdate determines if we should mark nodes as needing an update. + // NeedsRollingUpdate determines if we should mark nodes as needing an update. // Legal values are control-plane, workers, and all // Empty value means no update needed - NeedUpdate string `json:"needsRollingUpdate,omitempty"` + NeedsRollingUpdate string `json:"needsRollingUpdate,omitempty"` } func (a *Addons) Verify() error { diff --git a/channels/pkg/channels/addon.go b/channels/pkg/channels/addon.go index 66aeb1bd33..c3dada651f 100644 --- a/channels/pkg/channels/addon.go +++ b/channels/pkg/channels/addon.go @@ -149,7 +149,7 @@ func (a *Addon) EnsureUpdated(ctx context.Context, k8sClient kubernetes.Interfac return nil, fmt.Errorf("error applying update from %q: %v", manifestURL, err) } - if a.Spec.NeedUpdate != "" { + if a.Spec.NeedsRollingUpdate != "" { err = a.AddNeedsUpdateLabel(ctx, k8sClient) if err != nil { return nil, fmt.Errorf("error adding needs-update label: %v", err) @@ -166,9 +166,9 @@ func (a *Addon) EnsureUpdated(ctx context.Context, k8sClient kubernetes.Interfac } func (a *Addon) AddNeedsUpdateLabel(ctx context.Context, k8sClient kubernetes.Interface) error { - klog.Infof("addon %v wants to roll %v nodes", a.Name, a.Spec.NeedUpdate) + klog.Infof("addon %v wants to update %v nodes", a.Name, a.Spec.NeedsRollingUpdate) selector := "" - switch a.Spec.NeedUpdate { + switch a.Spec.NeedsRollingUpdate { case "control-plane": selector = "node-role.kubernetes.io/master=" case "worker": diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go index 8080a37160..faefc6cf32 100644 --- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go +++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go @@ -877,12 +877,12 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann location := key + "/" + id + "-v1.8.yaml" addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ - Name: fi.String(key), - Version: fi.String(version), - Selector: networkingSelector, - Manifest: fi.String(location), - Id: id, - NeedUpdate: "all", + Name: fi.String(key), + Version: fi.String(version), + Selector: networkingSelector, + Manifest: fi.String(location), + Id: id, + NeedsRollingUpdate: "all", }) } }