Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize cluster / nodegroup version before doing validations and … #5946

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

TiberiuGC
Copy link
Collaborator

Description

Closes https://github.com/weaveworks/eksctl-private/issues/471

When setting default containerRuntime and doing similar validation, we are currently comparing the clusterVersion with DockershimDeprecationVersion (i.e. 1.24). However this comparison turns out to be troublesome, as clusterVersion at that point doesn't always have a numeric format (e.g. 1.22), it can also be "", auto or latest. This PR standardises the version before doing the comparison.

Manual tests

1. Try to create a cluster on 1.24 with a nodeGroup with containerRuntime: dockerd

% ./eksctl create cluster --config-file cluster.yaml
Error: only containerd is supported for container runtime, starting with EKS version 1.24

2. Try to create a cluster on 1.24 with a nodeGroup without specifying containerRuntime explicitly

% ./eksctl create cluster --config-file cluster.yaml
EKS cluster "cluster-test" in "eu-north-1" region is ready

And now check the nodegroup containerRuntime was set to containerd

% kubectl get nodes --all-namespaces
Container Runtime Version:  containerd://1.6.6

3. Try to add a second nodeGroup to the cluster, with containerRuntime: dockerd, without setting cluster version.

This create nodegroup command shall fetch version number as 1.24 from control plane and realise the nodegroup can't be created.

 % ./eksctl create nodegroup --config-file cluster.yaml
will use latest version (1.24) for new nodegroup(s)
Error: could not create cluster provider from options: only containerd is supported for container runtime, starting with EKS version 1.24

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the userdocs directory)
  • Manually tested
  • [] Made sure the title of the PR is a good description that can go into the release notes
  • (Core team) Added labels for change area (e.g. area/nodegroup) and kind (e.g. kind/improvement)

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@TiberiuGC TiberiuGC added the skip-release-notes Causes PR not to show in release notes label Nov 18, 2022
@TiberiuGC TiberiuGC changed the base branch from main to release-0.120 November 18, 2022 13:01
Copy link
Collaborator

@Himangini Himangini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@TiberiuGC TiberiuGC merged commit 906c681 into release-0.120 Nov 18, 2022
@TiberiuGC TiberiuGC deleted the standardize-version branch November 18, 2022 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-release-notes Causes PR not to show in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants