Skip to content

Commit

Permalink
remove support for 1.18 (eksctl-io#5073)
Browse files Browse the repository at this point in the history
  • Loading branch information
aclevername authored and SlevinWasAlreadyTaken committed Apr 11, 2022
1 parent 1bef5dd commit 9bd7a55
Show file tree
Hide file tree
Showing 15 changed files with 1,032 additions and 586 deletions.
19 changes: 0 additions & 19 deletions pkg/actions/addon/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
"github.com/weaveworks/eksctl/pkg/cfn/waiter"
kubeclient "k8s.io/client-go/kubernetes"

"github.com/weaveworks/eksctl/pkg/utils"

"github.com/weaveworks/eksctl/pkg/cfn/manager"

iamoidc "github.com/weaveworks/eksctl/pkg/iam/oidc"
Expand All @@ -36,10 +34,6 @@ type Manager struct {
}

func New(clusterConfig *api.ClusterConfig, eksAPI eksiface.EKSAPI, stackManager manager.StackManager, withOIDC bool, oidcManager *iamoidc.OpenIDConnectManager, clientSet kubeclient.Interface, timeout time.Duration) (*Manager, error) {
if err := supportedVersion(clusterConfig.Metadata.Version); err != nil {
return nil, err
}

return &Manager{
clusterConfig: clusterConfig,
eksAPI: eksAPI,
Expand Down Expand Up @@ -118,19 +112,6 @@ func (a *Manager) getLatestMatchingVersion(addon *api.Addon) (string, error) {
return versions[0].Original(), nil
}

func supportedVersion(version string) error {
supported, err := utils.IsMinVersion(api.Version1_18, version)
if err != nil {
return err
}
switch supported {
case true:
return nil
default:
return fmt.Errorf("addons not supported on %s. Must be using %s or newer", version, api.Version1_18)
}
}

func (a *Manager) makeAddonName(name string) string {
return fmt.Sprintf("eksctl-%s-addon-%s", a.clusterConfig.Metadata.Name, name)
}
Expand Down
7 changes: 0 additions & 7 deletions pkg/actions/addon/addon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,4 @@ var _ = Describe("Addon", func() {
Expect(err).NotTo(HaveOccurred())
})
})

When("the version is not supported", func() {
It("errors", func() {
_, err := addon.New(&api.ClusterConfig{Metadata: &api.ClusterMeta{Version: "1.17"}}, &mocks.EKSAPI{}, nil, false, nil, nil, 5*time.Minute)
Expect(err).To(MatchError("addons not supported on 1.17. Must be using 1.18 or newer"))
})
})
})
18 changes: 9 additions & 9 deletions pkg/actions/cluster/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ var _ = Describe("upgrade cluster", func() {

Entry("upgrades by default when the version is not specified", upgradeCase{
givenVersion: "",
eksVersion: "1.17",
expectedUpgradeVersion: "1.18",
eksVersion: "1.18",
expectedUpgradeVersion: "1.19",
expectedUpgrade: true,
}),

Entry("upgrades by default when the version is auto", upgradeCase{
givenVersion: "auto",
eksVersion: "1.17",
expectedUpgradeVersion: "1.18",
eksVersion: "1.18",
expectedUpgradeVersion: "1.19",
expectedUpgrade: true,
}),

Expand All @@ -55,9 +55,9 @@ var _ = Describe("upgrade cluster", func() {
}),

Entry("upgrades to the next version when specified", upgradeCase{
givenVersion: "1.18",
eksVersion: "1.17",
expectedUpgradeVersion: "1.18",
givenVersion: "1.19",
eksVersion: "1.18",
expectedUpgradeVersion: "1.19",
expectedUpgrade: true,
}),

Expand All @@ -69,8 +69,8 @@ var _ = Describe("upgrade cluster", func() {
}),

Entry("fails when the upgrade jumps more than one kubernetes version", upgradeCase{
givenVersion: "1.18",
eksVersion: "1.16",
givenVersion: "1.19",
eksVersion: "1.17",
expectedErrorText: "upgrading more than one version at a time is not supported",
}),

Expand Down
Loading

0 comments on commit 9bd7a55

Please sign in to comment.