Skip to content

Commit

Permalink
Merge pull request eksctl-io#2708 from cPu1/fix-ng-upgrade-tags
Browse files Browse the repository at this point in the history
Update nodegroup stack w/ version tag before updating release version
  • Loading branch information
cPu1 authored Oct 5, 2020
2 parents 7191d26 + d1e3a89 commit 35309c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/cfn/manager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type StackInfo struct {
Template *string
}

// TemplateData is an union (sum type) to describe template data.
// TemplateData is a union (sum type) to describe template data.
type TemplateData interface {
isTemplateData()
}
Expand Down
21 changes: 11 additions & 10 deletions pkg/managed/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/pkg/errors"
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
"github.com/weaveworks/eksctl/pkg/version"
"github.com/weaveworks/goformation/v4/cloudformation"

"github.com/weaveworks/eksctl/pkg/ami"
Expand Down Expand Up @@ -184,7 +185,7 @@ func (m *Service) UpgradeNodeGroup(options UpgradeOptions) error {
return nil
}

requiresUpdate, err := m.requiresStackFormatUpdate(options.NodegroupName)
requiresUpdate, err := m.requiresStackUpdate(options.NodegroupName)
if err != nil {
return err
}
Expand Down Expand Up @@ -248,7 +249,7 @@ func (m *Service) UpgradeNodeGroup(options UpgradeOptions) error {
return nil
}

func (m *Service) requiresStackFormatUpdate(nodeGroupName string) (bool, error) {
func (m *Service) requiresStackUpdate(nodeGroupName string) (bool, error) {
ngStack, err := m.stackCollection.DescribeNodeGroupStack(nodeGroupName)
if err != nil {
return false, err
Expand All @@ -258,15 +259,15 @@ func (m *Service) requiresStackFormatUpdate(nodeGroupName string) (bool, error)
if err != nil {
return false, err
}
if found {
newFormatVersion := semver.Version{
Major: 0,
Minor: 25,
Patch: 0,
}
return ver.LT(newFormatVersion), nil
if !found {
return true, nil
}

curVer, err := semver.ParseTolerant(version.GetVersion())
if err != nil {
return false, errors.Wrap(err, "unexpected error parsing current eksctl version")
}
return true, nil
return !ver.EQ(curVer), nil
}

func (m *Service) getLatestReleaseVersion(kubernetesVersion string, nodeGroup *eks.Nodegroup) (string, error) {
Expand Down

0 comments on commit 35309c9

Please sign in to comment.