Skip to content

Commit

Permalink
feat(aws): bump up aws cloud provider version
Browse files Browse the repository at this point in the history
  • Loading branch information
JacieChao committed Jan 8, 2024
1 parent 16a23b9 commit 7faf7d5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
2 changes: 1 addition & 1 deletion hack/make-rules/autok3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
# The root of the autok3s directory
ROOT_DIR="${CURR_DIR}"
CROSS=${CROSS:-}
UI_VERSION="v0.9.0"
UI_VERSION="v0.9.2-rc1"

source "${ROOT_DIR}/hack/lib/init.sh"
source "${CURR_DIR}/hack/lib/constant.sh"
Expand Down
31 changes: 13 additions & 18 deletions pkg/providers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ var (
// the version according to this docs.
// The map key should be semver constraint and the value is the aws ccm version
ccmVersionMap = map[string]string{
">= 1.24": "v1.24.0",
"~1.23": "v1.23.1",
"~1.22": "v1.22.3",
"~1.21": "v1.21.2",
"~1.20": "v1.20.2",
">= 1.27": "v1.27.1",
"~1.26": "v1.26.1",
"~1.25": "v1.25.3",
"~1.24": "v1.24.4",
"~1.23": "v1.23.6",
"~1.22": "v1.22.7",
"~1.21": "v1.21.6",
"~1.20": "v1.20.4",
"~1.19": "v1.19.0-alpha.1",
"~1.18": "v1.18.0-alpha.1",
"< 1.18": "v1.18.0-alpha.1",
Expand Down Expand Up @@ -1041,18 +1044,10 @@ func (p *Amazon) deleteInstance(f bool) (string, error) {
}
return p.ContextName, nil
}
ui := p.UI
for _, comp := range p.Enable {
if !ui && comp == "dashboard" {
ui = true
}
}
// This is for backward compatibility as we don't support deploying kubernetes dashboard anymore.
// CCM will create elb for kubernetes dashboard so we need to delete dashboard before delete instance/cluster.
if ui && p.CloudControllerManager {
if err = p.ReleaseManifests(); err != nil {
return "", err
}

// CCM will create elb for kubernetes service
if p.CloudControllerManager {
p.Logger.Warnf("[%s] Please ensure all services has released before remove the cluster, if not, please check the AWS ELB to ensure all ELB has been released.", p.GetProviderName())
}
if err = p.terminateInstance(ids); err != nil {
return "", err
Expand Down Expand Up @@ -1230,7 +1225,7 @@ func getCCMVersion(k3sversion string) (string, error) {
}

// should never meet this condition because the version map covers all k8s version.
return ccmVersionMap[">= 1.24"], nil
return ccmVersionMap[">= 1.27"], nil
}

func getCCMExtraArgs(k3sversion string) ([]string, error) {
Expand Down
34 changes: 33 additions & 1 deletion pkg/providers/aws/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,45 @@ func TestGetCCMVersion(t *testing.T) {
ccmVersion string
}
for _, c := range []testCase{
{
k3sversion: "v1.21.14+k3s1",
ccmVersion: ccmVersionMap["~1.21"],
},
{
k3sversion: "v1.22.17+k3s1",
ccmVersion: ccmVersionMap["~1.22"],
},
{
k3sversion: "v1.23.7+k3s1",
ccmVersion: ccmVersionMap["~1.23"],
},
{
k3sversion: "v1.25.16+k3s4",
ccmVersion: ccmVersionMap["~1.25"],
},
{
k3sversion: "v1.26.11+k3s2",
ccmVersion: ccmVersionMap["~1.26"],
},
{
k3sversion: "v1.27.8+k3s2",
ccmVersion: ccmVersionMap[">= 1.27"],
},
{
k3sversion: "v1.28.4+k3s2",
ccmVersion: ccmVersionMap[">= 1.27"],
},
{
k3sversion: "v1.20.15+k3s1",
ccmVersion: ccmVersionMap["~1.20"],
},
{
k3sversion: "v1.24.3+k3s1",
ccmVersion: ccmVersionMap[">= 1.24"],
ccmVersion: ccmVersionMap["~1.24"],
},
{
k3sversion: "v1.19.16+k3s1",
ccmVersion: ccmVersionMap["~1.19"],
},
{
k3sversion: "v1.18.20+k3s1",
Expand Down

0 comments on commit 7faf7d5

Please sign in to comment.