Skip to content

Commit ae2cb93

Browse files
committed
Merge branch 'main' into mng-node-repair
2 parents db5ca15 + c1836a3 commit ae2cb93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+976
-420
lines changed

.mockery.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ packages:
2424
dir: "./pkg/eks/mocksv2"
2525
outpkg: mocksv2
2626

27-
github.com/aws/aws-sdk-go/aws/client:
28-
interfaces:
29-
ConfigProvider:
30-
config:
31-
dir: "./pkg/eks/mocks"
32-
outpkg: mocks
33-
3427
github.com/weaveworks/eksctl/pkg/ctl/utils:
3528
interfaces:
3629
VPCConfigUpdater:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# A sample ClusterConfig file that creates a cluster with support type set as "EXTENDED (default)".
2+
3+
# UpgradePolicy allows you to specify the support type for your cluster
4+
# Valid values are "STANDARD" and "EXTENDED (default)"
5+
# - https://docs.aws.amazon.com/eks/latest/APIReference/API_UpgradePolicyRequest.html
6+
7+
apiVersion: eksctl.io/v1alpha5
8+
kind: ClusterConfig
9+
10+
metadata:
11+
name: upgrade-policy-cluster
12+
region: us-west-2
13+
14+
upgradePolicy:
15+
supportType: "EXTENDED"
16+
17+
managedNodeGroups:
18+
- name: mng-1
19+
desiredCapacity: 1

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ go 1.25.1
77
require (
88
github.com/Masterminds/semver/v3 v3.4.0
99
github.com/aws/amazon-ec2-instance-selector/v3 v3.1.2
10-
github.com/aws/aws-sdk-go v1.55.8
1110
github.com/aws/aws-sdk-go-v2 v1.39.2
1211
github.com/aws/aws-sdk-go-v2/config v1.31.12
1312
github.com/aws/aws-sdk-go-v2/credentials v1.18.16
@@ -260,7 +259,6 @@ require (
260259
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
261260
github.com/jinzhu/copier v0.4.0 // indirect
262261
github.com/jjti/go-spancheck v0.6.4 // indirect
263-
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
264262
github.com/jmoiron/sqlx v1.4.0 // indirect
265263
github.com/josharian/intern v1.0.0 // indirect
266264
github.com/json-iterator/go v1.1.12 // indirect

go.sum

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z
9696
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
9797
github.com/aws/amazon-ec2-instance-selector/v3 v3.1.2 h1:F8GBspJo+RmR4rYyw75XywEEQHQxBbF7QYKaMMnYREc=
9898
github.com/aws/amazon-ec2-instance-selector/v3 v3.1.2/go.mod h1:wdlMRtz9G4IO6H1yZPsqfGBxR8E6B/bdxHlGkls4kGQ=
99-
github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=
100-
github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
10199
github.com/aws/aws-sdk-go-v2 v1.39.2 h1:EJLg8IdbzgeD7xgvZ+I8M1e0fL0ptn/M47lianzth0I=
102100
github.com/aws/aws-sdk-go-v2 v1.39.2/go.mod h1:sDioUELIUO9Znk23YVmIk86/9DOpkbyyVb1i/gUNFXY=
103101
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 h1:i8p8P4diljCr60PpJp6qZXNlgX4m2yQFpYk+9ZT+J4E=
@@ -551,10 +549,6 @@ github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
551549
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
552550
github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc=
553551
github.com/jjti/go-spancheck v0.6.4/go.mod h1:yAEYdKJ2lRkDA8g7X+oKUHXOWVAXSBJRv04OhF+QUjk=
554-
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW34dhU4az1GN0pTPADwNmvoRSeoZ6PItiqnY=
555-
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
556-
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
557-
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
558552
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
559553
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
560554
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -1406,7 +1400,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
14061400
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
14071401
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
14081402
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
1409-
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
14101403
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
14111404
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
14121405
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=

integration/data/test-dns.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
nodeSelector:
1414
used-for: test-pods
1515
containers:
16-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
16+
- image: public.ecr.aws/docker/library/busybox:1.36.1
1717
name: dns-test-cluster
1818
stdin: true
1919
tty: true
@@ -26,7 +26,7 @@ spec:
2626
command:
2727
- nslookup
2828
- kubernetes.default.svc.cluster.local.
29-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
29+
- image: public.ecr.aws/docker/library/busybox:1.36.1
3030
name: dns-test-eksctl
3131
stdin: true
3232
tty: true
@@ -39,7 +39,7 @@ spec:
3939
command:
4040
- nslookup
4141
- eksctl.io
42-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
42+
- image: public.ecr.aws/docker/library/busybox:1.36.1
4343
name: dns-test-k8s
4444
stdin: true
4545
tty: true
@@ -52,7 +52,7 @@ spec:
5252
command:
5353
- nslookup
5454
- k8s.io
55-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
55+
- image: public.ecr.aws/docker/library/busybox:1.36.1
5656
name: dns-test-kubernetes
5757
stdin: true
5858
tty: true
@@ -65,7 +65,7 @@ spec:
6565
command:
6666
- nslookup
6767
- kubernetes.io
68-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
68+
- image: public.ecr.aws/docker/library/busybox:1.36.1
6969
name: dns-test-eks-us
7070
stdin: true
7171
tty: true
@@ -78,7 +78,7 @@ spec:
7878
command:
7979
- nslookup
8080
- EKS.us-east-1.amazonaws.com
81-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
81+
- image: public.ecr.aws/docker/library/busybox:1.36.1
8282
name: dns-test-eks-eu
8383
stdin: true
8484
tty: true
@@ -91,7 +91,7 @@ spec:
9191
command:
9292
- nslookup
9393
- EKS.eu-west-1.amazonaws.com
94-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
94+
- image: public.ecr.aws/docker/library/busybox:1.36.1
9595
name: dns-test-ec2-us
9696
stdin: true
9797
tty: true
@@ -104,7 +104,7 @@ spec:
104104
command:
105105
- nslookup
106106
- ec2.us-east-2.amazonaws.com
107-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
107+
- image: public.ecr.aws/docker/library/busybox:1.36.1
108108
name: dns-test-ec2-eu
109109
stdin: true
110110
tty: true
@@ -117,7 +117,7 @@ spec:
117117
command:
118118
- nslookup
119119
- ec2.eu-west-2.amazonaws.com
120-
- image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
120+
- image: public.ecr.aws/docker/library/busybox:1.36.1
121121
name: dns-test-ifconfig
122122
stdin: true
123123
tty: true
@@ -129,4 +129,4 @@ spec:
129129
exec:
130130
command:
131131
- nslookup
132-
- ifconfig.co
132+
- ifconfig.co

integration/tests/accessentries/accessentries_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ var _ = Describe("(Integration) [AccessEntries Test]", func() {
329329
).Run()
330330
Expect(session.ExitCode()).To(Equal(0))
331331
Expect(json.Unmarshal(session.Out.Contents(), &output)).To(Succeed())
332-
Expect(output).To(HaveLen(2))
332+
// Don't check access entries length. AWS may add additional access entries like
333+
// a cluster-access-policy/AmazonEKSClusterInsightsPolicy.
333334
Expect(output).To(ContainElements(cfg.AccessConfig.AccessEntries))
334335
})
335336

integration/tests/addons/addons_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,10 @@ var _ = Describe("(Integration) [EKS Addons test]", func() {
808808

809809
By("removing all pod identity associations owned by the addon")
810810
clusterConfig.Addons[1].PodIdentityAssociations = &[]api.PodIdentityAssociation{}
811-
Expect(makeUpdateAddonCMD()).To(RunSuccessfully())
811+
// Don't wait for aws-ebs-csi-driver add-on because it won't become healthy without iam perms now.
812+
// Update add-on has a bug where we wait even if we don't pass in --wait.
813+
// We should fix that bug eventually then we can remove this timeout and fail condition.
814+
Expect(makeUpdateAddonCMD("--timeout", "2m")).NotTo(RunSuccessfully())
812815
assertAddonHasPodIDs(api.AWSEBSCSIDriverAddon, 0)
813816

814817
By("migrating an addon to pod identity using the utils command")

integration/tests/enhanced_node_repair/enhanced_node_repair_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package enhanced_node_repair
4+
package enhancednoderepair
55

66
import (
77
"fmt"
@@ -78,7 +78,7 @@ managedNodeGroups:
7878
defer os.Remove(configFile)
7979

8080
By("testing YAML config generates correct CloudFormation")
81-
cmd := params.EksctlCreateCmd.WithArgs(
81+
cmd := params.EksctlCreateCmd.WithoutArg("--region", params.Region).WithArgs(
8282
"cluster",
8383
"--config-file", configFile,
8484
"--dry-run",
@@ -112,7 +112,6 @@ managedNodeGroups:
112112
"--dry-run",
113113
)
114114
Expect(cmd).NotTo(RunSuccessfully())
115-
Expect(cmd).To(RunWithError(ContainSubstring("only valid with managed nodegroups")))
116115
})
117116

118117
It("should handle invalid YAML configuration gracefully", func() {
@@ -138,7 +137,7 @@ nodeGroups:
138137
defer os.Remove(configFile)
139138

140139
By("testing invalid config is rejected")
141-
cmd := params.EksctlCreateCmd.WithArgs(
140+
cmd := params.EksctlCreateCmd.WithoutArg("--region", params.Region).WithArgs(
142141
"cluster",
143142
"--config-file", configFile,
144143
"--dry-run",
@@ -147,4 +146,4 @@ nodeGroups:
147146
Expect(cmd).NotTo(RunSuccessfully())
148147
})
149148
})
150-
})
149+
})

integration/tests/update/update_cluster_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,6 @@ var _ = Describe("(Integration) Upgrading cluster", func() {
250250
})
251251

252252
It("should upgrade aws-node", func() {
253-
rawClient := getRawClient(context.Background(), clusterProvider)
254-
getAWSNodeVersion := func() string {
255-
awsNode, err := rawClient.ClientSet().AppsV1().DaemonSets(metav1.NamespaceSystem).Get(context.TODO(), "aws-node", metav1.GetOptions{})
256-
Expect(err).NotTo(HaveOccurred())
257-
imageTag, err := addons.ImageTag(awsNode.Spec.Template.Spec.Containers[0].Image)
258-
Expect(err).NotTo(HaveOccurred())
259-
return imageTag
260-
}
261-
preUpdateAWSNodeVersion := getAWSNodeVersion()
262-
263253
cmd := params.EksctlUpdateCmd.
264254
WithArgs(
265255
"addon",
@@ -270,7 +260,6 @@ var _ = Describe("(Integration) Upgrading cluster", func() {
270260
"--verbose", "4",
271261
)
272262
Expect(cmd).To(RunSuccessfully())
273-
Eventually(getAWSNodeVersion, addonUpdatePollTimeout, k8sUpdatePollInterval).ShouldNot(Equal(preUpdateAWSNodeVersion))
274263
})
275264

276265
It("should upgrade coredns", func() {

pkg/actions/addon/addon_helper.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,17 @@ func (a *Helper) ValidateNodeGroupCreation(ctx context.Context) error {
3737
}
3838
return nil
3939
}
40+
41+
func ShouldWaitForAddons(nodes bool, addons []*api.Addon) bool {
42+
addonsRequireWait := false
43+
for _, a := range addons {
44+
addonInfo, ok := api.KnownAddons[a.Name]
45+
// Assume unknown add-ons need to wait.
46+
if !ok || !addonInfo.DontRequireWait {
47+
addonsRequireWait = true
48+
break
49+
}
50+
}
51+
52+
return nodes && addonsRequireWait
53+
}

0 commit comments

Comments
 (0)