Skip to content

Commit b4441d9

Browse files
committed
Fix addon integration tests
1 parent 70923e6 commit b4441d9

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

integration/tests/addons/addons_test.go

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,34 @@ var _ = Describe("(Integration) [EKS Addons test]", func() {
155155
})
156156

157157
It("should have full control over configMap when creating addons", func() {
158-
var (
159-
clusterConfig *api.ClusterConfig
160-
configMap *corev1.ConfigMap
161-
)
158+
clusterConfig := getInitialClusterConfig()
159+
clusterConfig.Addons = []*api.Addon{
160+
{
161+
Name: "coredns",
162+
Version: "latest",
163+
},
164+
}
165+
cmd := params.EksctlCreateCmd.
166+
WithArgs(
167+
"addon",
168+
"--config-file", "-",
169+
).
170+
WithoutArg("--region", params.Region).
171+
WithStdin(clusterutils.Reader(clusterConfig))
172+
Expect(cmd).To(RunSuccessfully())
162173

163-
configMap = getConfigMap(rawClient.ClientSet(), "coredns")
174+
cmd = params.EksctlDeleteCmd.
175+
WithArgs(
176+
"addon",
177+
"--name", "coredns",
178+
"--cluster", clusterName,
179+
"--verbose", "2",
180+
"--region", params.Region,
181+
"--preserve",
182+
)
183+
Expect(cmd).To(RunSuccessfully())
184+
185+
configMap := getConfigMap(rawClient.ClientSet(), "coredns")
164186
oldCacheValue := getCacheValue(configMap)
165187
newCacheValue := addToString(oldCacheValue, 5)
166188
updateCacheValue(configMap, oldCacheValue, newCacheValue)
@@ -178,7 +200,7 @@ var _ = Describe("(Integration) [EKS Addons test]", func() {
178200
data, err := json.Marshal(clusterConfig)
179201
Expect(err).NotTo(HaveOccurred())
180202

181-
cmd := params.EksctlCreateCmd.
203+
cmd = params.EksctlCreateCmd.
182204
WithArgs(
183205
"addon",
184206
"--config-file", "-",

0 commit comments

Comments
 (0)