@@ -21,6 +21,7 @@ package e2e
21
21
import (
22
22
"os"
23
23
"path/filepath"
24
+ "strings"
24
25
25
26
. "github.com/onsi/ginkgo/v2"
26
27
. "github.com/onsi/gomega"
@@ -138,7 +139,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
138
139
Expect (err ).ToNot (HaveOccurred ())
139
140
fullChartInstall , err := os .ReadFile (filepath .Join (customManifestsFolder , "full-chart-install.yaml" ))
140
141
Expect (err ).ToNot (HaveOccurred ())
141
- Expect (manifests ).To (Equal (string (fullChartInstall )))
142
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (fullChartInstall ) )))
142
143
})
143
144
144
145
It ("should not deploy providers when none specified" , func () {
@@ -168,7 +169,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
168
169
Expect (manifests ).ToNot (BeEmpty ())
169
170
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-custom-ns-versions.yaml" ))
170
171
Expect (err ).ToNot (HaveOccurred ())
171
- Expect (manifests ).To (Equal (string (expectedManifests )))
172
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
172
173
})
173
174
174
175
It ("should deploy all providers with custom versions" , func () {
@@ -186,7 +187,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
186
187
Expect (manifests ).ToNot (BeEmpty ())
187
188
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-custom-versions.yaml" ))
188
189
Expect (err ).ToNot (HaveOccurred ())
189
- Expect (manifests ).To (Equal (string (expectedManifests )))
190
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
190
191
})
191
192
192
193
It ("should deploy all providers with latest version" , func () {
@@ -204,7 +205,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
204
205
Expect (manifests ).ToNot (BeEmpty ())
205
206
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-latest-versions.yaml" ))
206
207
Expect (err ).ToNot (HaveOccurred ())
207
- Expect (manifests ).To (Equal (string (expectedManifests )))
208
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
208
209
})
209
210
210
211
It ("should deploy core, bootstrap, control plane when only infra is specified" , func () {
@@ -217,7 +218,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
217
218
Expect (manifests ).ToNot (BeEmpty ())
218
219
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-infra.yaml" ))
219
220
Expect (err ).ToNot (HaveOccurred ())
220
- Expect (manifests ).To (Equal (string (expectedManifests )))
221
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
221
222
})
222
223
223
224
It ("should deploy core when only bootstrap is specified" , func () {
@@ -230,7 +231,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
230
231
Expect (manifests ).ToNot (BeEmpty ())
231
232
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-bootstrap.yaml" ))
232
233
Expect (err ).ToNot (HaveOccurred ())
233
- Expect (manifests ).To (Equal (string (expectedManifests )))
234
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
234
235
})
235
236
236
237
It ("should deploy core when only control plane is specified" , func () {
@@ -243,7 +244,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
243
244
Expect (manifests ).ToNot (BeEmpty ())
244
245
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-control-plane.yaml" ))
245
246
Expect (err ).ToNot (HaveOccurred ())
246
- Expect (manifests ).To (Equal (string (expectedManifests )))
247
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
247
248
})
248
249
249
250
It ("should deploy core when only ipam is specified" , func () {
@@ -256,7 +257,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
256
257
Expect (manifests ).ToNot (BeEmpty ())
257
258
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-ipam.yaml" ))
258
259
Expect (err ).ToNot (HaveOccurred ())
259
- Expect (manifests ).To (Equal (string (expectedManifests )))
260
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
260
261
})
261
262
262
263
It ("should deploy core, bootstrap, control plane when only infra and ipam is specified" , func () {
@@ -270,7 +271,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
270
271
Expect (manifests ).ToNot (BeEmpty ())
271
272
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-infra-and-ipam.yaml" ))
272
273
Expect (err ).ToNot (HaveOccurred ())
273
- Expect (manifests ).To (Equal (string (expectedManifests )))
274
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
274
275
})
275
276
276
277
It ("should deploy multiple infra providers with custom namespace and versions" , func () {
@@ -286,7 +287,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
286
287
Expect (manifests ).ToNot (BeEmpty ())
287
288
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "multiple-infra-custom-ns-versions.yaml" ))
288
289
Expect (err ).ToNot (HaveOccurred ())
289
- Expect (manifests ).To (Equal (string (expectedManifests )))
290
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
290
291
})
291
292
292
293
It ("should deploy multiple control plane providers with custom namespace and versions" , func () {
@@ -302,7 +303,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
302
303
Expect (manifests ).ToNot (BeEmpty ())
303
304
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "multiple-control-plane-custom-ns-versions.yaml" ))
304
305
Expect (err ).ToNot (HaveOccurred ())
305
- Expect (manifests ).To (Equal (string (expectedManifests )))
306
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
306
307
})
307
308
308
309
It ("should deploy multiple bootstrap providers with custom namespace and versions" , func () {
@@ -318,7 +319,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
318
319
Expect (manifests ).ToNot (BeEmpty ())
319
320
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "multiple-bootstrap-custom-ns-versions.yaml" ))
320
321
Expect (err ).ToNot (HaveOccurred ())
321
- Expect (manifests ).To (Equal (string (expectedManifests )))
322
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
322
323
})
323
324
324
325
It ("should deploy core when only addon is specified" , func () {
@@ -331,7 +332,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
331
332
Expect (manifests ).ToNot (BeEmpty ())
332
333
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-addon.yaml" ))
333
334
Expect (err ).ToNot (HaveOccurred ())
334
- Expect (manifests ).To (Equal (string (expectedManifests )))
335
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
335
336
})
336
337
337
338
It ("should deploy core, bootstrap, control plane when only infra and addon is specified" , func () {
@@ -345,7 +346,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
345
346
Expect (manifests ).ToNot (BeEmpty ())
346
347
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-infra-and-addon.yaml" ))
347
348
Expect (err ).ToNot (HaveOccurred ())
348
- Expect (manifests ).To (Equal (string (expectedManifests )))
349
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
349
350
})
350
351
It ("should deploy core and infra with feature gates enabled" , func () {
351
352
manifests , err := helmChart .Run (map [string ]string {
@@ -367,7 +368,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
367
368
Expect (manifests ).ToNot (BeEmpty ())
368
369
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "feature-gates.yaml" ))
369
370
Expect (err ).ToNot (HaveOccurred ())
370
- Expect (manifests ).To (Equal (string (expectedManifests )))
371
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
371
372
})
372
373
It ("should deploy all providers with manager defined but no feature gates enabled" , func () {
373
374
manifests , err := helmChart .Run (map [string ]string {
@@ -382,7 +383,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
382
383
Expect (manifests ).ToNot (BeEmpty ())
383
384
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-manager-defined-no-feature-gates.yaml" ))
384
385
Expect (err ).ToNot (HaveOccurred ())
385
- Expect (manifests ).To (Equal (string (expectedManifests )))
386
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
386
387
})
387
388
It ("should deploy all providers when manager is defined but another infrastructure spec field is defined" , func () {
388
389
manifests , err := helmChart .Run (map [string ]string {
@@ -399,7 +400,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
399
400
Expect (manifests ).ToNot (BeEmpty ())
400
401
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "manager-defined-missing-other-infra-spec.yaml" ))
401
402
Expect (err ).ToNot (HaveOccurred ())
402
- Expect (manifests ).To (Equal (string (expectedManifests )))
403
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
403
404
})
404
405
It ("should deploy kubeadm control plane with manager specified" , func () {
405
406
manifests , err := helmChart .Run (map [string ]string {
@@ -416,6 +417,6 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
416
417
Expect (manifests ).ToNot (BeEmpty ())
417
418
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "kubeadm-manager-defined.yaml" ))
418
419
Expect (err ).ToNot (HaveOccurred ())
419
- Expect (manifests ).To (Equal (string (expectedManifests )))
420
+ Expect (manifests ).To (Equal (strings . TrimSpace ( string (expectedManifests ) )))
420
421
})
421
422
})
0 commit comments