Rename NeedUpdate struct to NeedsRollingUpdate

This commit is contained in:
Ole Markus With 2020-11-16 07:27:00 +01:00
parent 2659a30280
commit f4e3dd3e26
3 changed files with 11 additions and 11 deletions

View File

@ -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 {

View File

@ -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":

View File

@ -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",
})
}
}