@@ -42,7 +42,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
42
42
manifests , err := fullRun .Run (nil )
43
43
Expect (err ).ToNot (HaveOccurred ())
44
44
fullChartInstall , err := os .ReadFile (filepath .Join (customManifestsFolder , "full-chart-install.yaml" ))
45
- Expect (manifests ).To (Equal (string (fullChartInstall )))
45
+ Expect (manifests ).To (MatchYAML (string (fullChartInstall )))
46
46
})
47
47
48
48
It ("should not deploy providers when none specified" , func () {
@@ -65,7 +65,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
65
65
Expect (manifests ).ToNot (BeEmpty ())
66
66
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-custom-ns-versions.yaml" ))
67
67
Expect (err ).ToNot (HaveOccurred ())
68
- Expect (manifests ).To (Equal (string (expectedManifests )))
68
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
69
69
})
70
70
71
71
It ("should deploy all providers with custom versions" , func () {
@@ -82,7 +82,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
82
82
Expect (manifests ).ToNot (BeEmpty ())
83
83
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-custom-versions.yaml" ))
84
84
Expect (err ).ToNot (HaveOccurred ())
85
- Expect (manifests ).To (Equal (string (expectedManifests )))
85
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
86
86
})
87
87
88
88
It ("should deploy all providers with latest version" , func () {
@@ -99,7 +99,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
99
99
Expect (manifests ).ToNot (BeEmpty ())
100
100
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-latest-versions.yaml" ))
101
101
Expect (err ).ToNot (HaveOccurred ())
102
- Expect (manifests ).To (Equal (string (expectedManifests )))
102
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
103
103
})
104
104
105
105
It ("should deploy core, bootstrap, control plane when only infra is specified" , func () {
@@ -112,7 +112,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
112
112
Expect (manifests ).ToNot (BeEmpty ())
113
113
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-infra.yaml" ))
114
114
Expect (err ).ToNot (HaveOccurred ())
115
- Expect (manifests ).To (Equal (string (expectedManifests )))
115
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
116
116
})
117
117
118
118
It ("should deploy core when only bootstrap is specified" , func () {
@@ -125,7 +125,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
125
125
Expect (manifests ).ToNot (BeEmpty ())
126
126
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-bootstrap.yaml" ))
127
127
Expect (err ).ToNot (HaveOccurred ())
128
- Expect (manifests ).To (Equal (string (expectedManifests )))
128
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
129
129
})
130
130
131
131
It ("should deploy core when only control plane is specified" , func () {
@@ -138,7 +138,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
138
138
Expect (manifests ).ToNot (BeEmpty ())
139
139
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-control-plane.yaml" ))
140
140
Expect (err ).ToNot (HaveOccurred ())
141
- Expect (manifests ).To (Equal (string (expectedManifests )))
141
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
142
142
})
143
143
144
144
It ("should deploy multiple infra providers with custom namespace and versions" , func () {
@@ -151,7 +151,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
151
151
Expect (manifests ).ToNot (BeEmpty ())
152
152
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "multiple-infra-custom-ns-versions.yaml" ))
153
153
Expect (err ).ToNot (HaveOccurred ())
154
- Expect (manifests ).To (Equal (string (expectedManifests )))
154
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
155
155
})
156
156
157
157
It ("should deploy multiple control plane providers with custom namespace and versions" , func () {
@@ -164,7 +164,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
164
164
Expect (manifests ).ToNot (BeEmpty ())
165
165
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "multiple-control-plane-custom-ns-versions.yaml" ))
166
166
Expect (err ).ToNot (HaveOccurred ())
167
- Expect (manifests ).To (Equal (string (expectedManifests )))
167
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
168
168
})
169
169
170
170
It ("should deploy multiple bootstrap providers with custom namespace and versions" , func () {
@@ -177,7 +177,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
177
177
Expect (manifests ).ToNot (BeEmpty ())
178
178
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "multiple-bootstrap-custom-ns-versions.yaml" ))
179
179
Expect (err ).ToNot (HaveOccurred ())
180
- Expect (manifests ).To (Equal (string (expectedManifests )))
180
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
181
181
})
182
182
183
183
It ("should deploy core when only addon is specified" , func () {
@@ -190,7 +190,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
190
190
Expect (manifests ).ToNot (BeEmpty ())
191
191
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-addon.yaml" ))
192
192
Expect (err ).ToNot (HaveOccurred ())
193
- Expect (manifests ).To (Equal (string (expectedManifests )))
193
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
194
194
})
195
195
196
196
It ("should deploy core, bootstrap, control plane when only infra and addon is specified" , func () {
@@ -204,7 +204,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
204
204
Expect (manifests ).ToNot (BeEmpty ())
205
205
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "only-infra-and-addon.yaml" ))
206
206
Expect (err ).ToNot (HaveOccurred ())
207
- Expect (manifests ).To (Equal (string (expectedManifests )))
207
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
208
208
})
209
209
It ("should deploy core and infra with feature gates enabled" , func () {
210
210
manifests , err := helmChart .Run (map [string ]string {
@@ -227,6 +227,38 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
227
227
Expect (manifests ).ToNot (BeEmpty ())
228
228
expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "feature-gates.yaml" ))
229
229
Expect (err ).ToNot (HaveOccurred ())
230
- Expect (manifests ).To (Equal (string (expectedManifests )))
230
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
231
+ })
232
+ It ("should deploy all providers with manager defined but no feature gates enabled" , func () {
233
+ manifests , err := helmChart .Run (map [string ]string {
234
+ "configSecret.name" : "test-secret-name" ,
235
+ "configSecret.namespace" : "test-secret-namespace" ,
236
+ "infrastructure" : "azure" ,
237
+ "addon" : "helm" ,
238
+ "core" : "cluster-api" ,
239
+ "manager.cert-manager.enabled" : "false" ,
240
+ "manager.cert-manager.installCRDs" : "false" ,
241
+ })
242
+ Expect (err ).ToNot (HaveOccurred ())
243
+ Expect (manifests ).ToNot (BeEmpty ())
244
+ expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "all-providers-latest-versions.yaml" ))
245
+ Expect (err ).ToNot (HaveOccurred ())
246
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
247
+ })
248
+ It ("should deploy all providers when manager is defined but another infrastructure spec field is defined" , func () {
249
+ manifests , err := helmChart .Run (map [string ]string {
250
+ "core" : "cluster-api" ,
251
+ "controlPlane" : "kubeadm" ,
252
+ "bootstrap" : "kubeadm" ,
253
+ "infrastructure" : "docker" ,
254
+ "addon" : "helm" ,
255
+ "manager.featureGates.core.ClusterTopology" : "true" ,
256
+ "manager.featureGates.core.MachinePool" : "true" ,
257
+ })
258
+ Expect (err ).ToNot (HaveOccurred ())
259
+ Expect (manifests ).ToNot (BeEmpty ())
260
+ expectedManifests , err := os .ReadFile (filepath .Join (customManifestsFolder , "manager-defined-missing-other-infra-spec.yaml" ))
261
+ Expect (err ).ToNot (HaveOccurred ())
262
+ Expect (manifests ).To (MatchYAML (string (expectedManifests )))
231
263
})
232
264
})
0 commit comments