|
17 | 17 | clusterGroupName: test |
18 | 18 | ` |
19 | 19 |
|
| 20 | +const customGlobalValuesWithSingleArgoCDFalse = ` |
| 21 | +global: |
| 22 | + pattern: test-pattern |
| 23 | + singleArgoCD: false |
| 24 | +main: |
| 25 | + clusterGroupName: test |
| 26 | +` |
| 27 | + |
20 | 28 | const customClusterGroupValues = ` |
21 | 29 | clusterGroup: |
22 | 30 | name: test |
@@ -65,7 +73,8 @@ var _ = Describe("patternizer init", func() { |
65 | 73 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
66 | 74 | expectedGlobalValues := types.ValuesGlobal{ |
67 | 75 | Global: types.Global{ |
68 | | - Pattern: filepath.Base(tempDir), |
| 76 | + Pattern: filepath.Base(tempDir), |
| 77 | + SingleArgoCD: true, |
69 | 78 | SecretLoader: types.SecretLoader{ |
70 | 79 | Disabled: true, |
71 | 80 | }, |
@@ -117,7 +126,8 @@ var _ = Describe("patternizer init", func() { |
117 | 126 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
118 | 127 | expectedGlobalValues := types.ValuesGlobal{ |
119 | 128 | Global: types.Global{ |
120 | | - Pattern: filepath.Base(tempDir), |
| 129 | + Pattern: filepath.Base(tempDir), |
| 130 | + SingleArgoCD: true, |
121 | 131 | SecretLoader: types.SecretLoader{ |
122 | 132 | Disabled: true, |
123 | 133 | }, |
@@ -180,7 +190,8 @@ var _ = Describe("patternizer init", func() { |
180 | 190 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
181 | 191 | expectedGlobalValues := types.ValuesGlobal{ |
182 | 192 | Global: types.Global{ |
183 | | - Pattern: "test-pattern", |
| 193 | + Pattern: "test-pattern", |
| 194 | + SingleArgoCD: true, |
184 | 195 | SecretLoader: types.SecretLoader{ |
185 | 196 | Disabled: true, |
186 | 197 | }, |
@@ -232,7 +243,8 @@ var _ = Describe("patternizer init", func() { |
232 | 243 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
233 | 244 | expectedGlobalValues := types.ValuesGlobal{ |
234 | 245 | Global: types.Global{ |
235 | | - Pattern: "test-pattern", |
| 246 | + Pattern: "test-pattern", |
| 247 | + SingleArgoCD: true, |
236 | 248 | SecretLoader: types.SecretLoader{ |
237 | 249 | Disabled: true, |
238 | 250 | }, |
@@ -271,6 +283,41 @@ var _ = Describe("patternizer init", func() { |
271 | 283 | verifyClusterGroupValues(clusterGroupValuesFile, &expectedClusterGroupValues) |
272 | 284 | }) |
273 | 285 | }) |
| 286 | + |
| 287 | + Context("on a directory with singleArgoCD explicitly set to false", Ordered, func() { |
| 288 | + var tempDir string |
| 289 | + |
| 290 | + BeforeAll(func() { |
| 291 | + tempDir = createTestDir() |
| 292 | + Expect(os.WriteFile(filepath.Join(tempDir, "values-global.yaml"), []byte(customGlobalValuesWithSingleArgoCDFalse), 0o644)).To(Succeed()) |
| 293 | + _ = runCLI(tempDir, "init") |
| 294 | + }) |
| 295 | + |
| 296 | + AfterAll(func() { |
| 297 | + os.RemoveAll(tempDir) |
| 298 | + }) |
| 299 | + |
| 300 | + It("should respect the explicit singleArgoCD override", func() { |
| 301 | + globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
| 302 | + expectedGlobalValues := types.ValuesGlobal{ |
| 303 | + Global: types.Global{ |
| 304 | + Pattern: "test-pattern", |
| 305 | + SingleArgoCD: false, |
| 306 | + SecretLoader: types.SecretLoader{ |
| 307 | + Disabled: true, |
| 308 | + }, |
| 309 | + }, |
| 310 | + Main: types.Main{ |
| 311 | + ClusterGroupName: "test", |
| 312 | + MultiSourceConfig: types.MultiSourceConfig{ |
| 313 | + Enabled: true, |
| 314 | + ClusterGroupChartVersion: "0.9.*", |
| 315 | + }, |
| 316 | + }, |
| 317 | + } |
| 318 | + verifyGlobalValues(globalValuesFile, &expectedGlobalValues) |
| 319 | + }) |
| 320 | + }) |
274 | 321 | }) |
275 | 322 |
|
276 | 323 | var _ = Describe("patternizer init --with-secrets", func() { |
@@ -298,7 +345,8 @@ var _ = Describe("patternizer init --with-secrets", func() { |
298 | 345 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
299 | 346 | expectedGlobalValues := types.ValuesGlobal{ |
300 | 347 | Global: types.Global{ |
301 | | - Pattern: filepath.Base(tempDir), |
| 348 | + Pattern: filepath.Base(tempDir), |
| 349 | + SingleArgoCD: true, |
302 | 350 | SecretLoader: types.SecretLoader{ |
303 | 351 | Disabled: false, |
304 | 352 | }, |
@@ -383,7 +431,8 @@ var _ = Describe("patternizer init --with-secrets", func() { |
383 | 431 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
384 | 432 | expectedGlobalValues := types.ValuesGlobal{ |
385 | 433 | Global: types.Global{ |
386 | | - Pattern: filepath.Base(tempDir), |
| 434 | + Pattern: filepath.Base(tempDir), |
| 435 | + SingleArgoCD: true, |
387 | 436 | SecretLoader: types.SecretLoader{ |
388 | 437 | Disabled: false, |
389 | 438 | }, |
@@ -478,7 +527,8 @@ var _ = Describe("patternizer init --with-secrets", func() { |
478 | 527 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
479 | 528 | expectedGlobalValues := types.ValuesGlobal{ |
480 | 529 | Global: types.Global{ |
481 | | - Pattern: "test-pattern", |
| 530 | + Pattern: "test-pattern", |
| 531 | + SingleArgoCD: true, |
482 | 532 | SecretLoader: types.SecretLoader{ |
483 | 533 | Disabled: false, |
484 | 534 | }, |
@@ -560,7 +610,8 @@ var _ = Describe("patternizer init --with-secrets", func() { |
560 | 610 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
561 | 611 | expectedGlobalValues := types.ValuesGlobal{ |
562 | 612 | Global: types.Global{ |
563 | | - Pattern: filepath.Base(tempDir), |
| 613 | + Pattern: filepath.Base(tempDir), |
| 614 | + SingleArgoCD: true, |
564 | 615 | SecretLoader: types.SecretLoader{ |
565 | 616 | Disabled: false, |
566 | 617 | }, |
@@ -656,7 +707,8 @@ var _ = Describe("patternizer init --with-secrets", func() { |
656 | 707 | globalValuesFile := filepath.Join(tempDir, "values-global.yaml") |
657 | 708 | expectedGlobalValues := types.ValuesGlobal{ |
658 | 709 | Global: types.Global{ |
659 | | - Pattern: "test-pattern", |
| 710 | + Pattern: "test-pattern", |
| 711 | + SingleArgoCD: true, |
660 | 712 | SecretLoader: types.SecretLoader{ |
661 | 713 | Disabled: false, |
662 | 714 | }, |
|
0 commit comments