Skip to content

Commit 41fa00f

Browse files
authored
comment out CatalogDestination.BaseImage while we mature the concept (#1090)
* comment out CatalogDestination.BaseImage while we mature the concept Signed-off-by: Jordan Keister <[email protected]> * removed baseImage from test data and validations Signed-off-by: Jordan Keister <[email protected]> --------- Signed-off-by: Jordan Keister <[email protected]>
1 parent 00a4cce commit 41fa00f

File tree

3 files changed

+22
-27
lines changed

3 files changed

+22
-27
lines changed

alpha/template/composite/composite.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ func (t *Template) newCatalogBuilderMap(catalogs []Catalog, outputType string) (
215215
setupErrors := map[string][]string{}
216216
for _, catalog := range catalogs {
217217
errs := []string{}
218-
if catalog.Destination.BaseImage == "" {
219-
errs = append(errs, "destination.baseImage must not be an empty string")
220-
}
218+
// if catalog.Destination.BaseImage == "" {
219+
// errs = append(errs, "destination.baseImage must not be an empty string")
220+
// }
221221

222222
if catalog.Destination.WorkingDir == "" {
223223
errs = append(errs, "destination.workingDir must not be an empty string")

alpha/template/composite/composite_test.go

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ schema: olm.composite.catalogs
4242
catalogs:
4343
- name: first-catalog
4444
destination:
45-
baseImage: quay.io/operator-framework/opm:latest
4645
workingDir: contributions/first-catalog
4746
builders:
4847
- olm.builder.test
@@ -298,20 +297,17 @@ schema: olm.composite.catalogs
298297
catalogs:
299298
- name: first-catalog
300299
destination:
301-
baseImage: quay.io/operator-framework/opm:latest
302300
workingDir: contributions/first-catalog
303301
builders:
304302
- olm.builder.semver
305303
- olm.builder.basic
306304
- name: second-catalog
307305
destination:
308-
baseImage: quay.io/operator-framework/opm:latest
309306
workingDir: contributions/second-catalog
310307
builders:
311308
- olm.builder.semver
312309
- name: test-catalog
313310
destination:
314-
baseImage: quay.io/operator-framework/opm:latest
315311
workingDir: contributions/test-catalog
316312
builders:
317313
- olm.builder.custom`
@@ -325,7 +321,6 @@ schema: invalid
325321
catalogs:
326322
- name: first-catalog
327323
destination:
328-
baseImage: quay.io/operator-framework/opm:latest
329324
workingDir: contributions/first-catalog
330325
builders:
331326
- olm.builder.semver
@@ -463,7 +458,7 @@ func TestNewCatalogBuilderMap(t *testing.T) {
463458
Name: "test-catalog",
464459
Destination: CatalogDestination{
465460
WorkingDir: "/",
466-
BaseImage: "base",
461+
// BaseImage: "base",
467462
},
468463
Builders: []string{
469464
BasicBuilderSchema,
@@ -482,7 +477,7 @@ func TestNewCatalogBuilderMap(t *testing.T) {
482477
Name: "test-catalog",
483478
Destination: CatalogDestination{
484479
WorkingDir: "/",
485-
BaseImage: "base",
480+
// BaseImage: "base",
486481
},
487482
Builders: []string{
488483
"invalid",
@@ -494,22 +489,22 @@ func TestNewCatalogBuilderMap(t *testing.T) {
494489
require.Equal(t, "getting builder \"invalid\" for catalog \"test-catalog\": unknown schema \"invalid\"", err.Error())
495490
},
496491
},
497-
{
498-
name: "BaseImage+WorkingDir invalid",
499-
catalogs: []Catalog{
500-
{
501-
Name: "test-catalog",
502-
Destination: CatalogDestination{},
503-
Builders: []string{
504-
BasicBuilderSchema,
505-
},
506-
},
507-
},
508-
assertions: func(t *testing.T, builderMap *CatalogBuilderMap, err error) {
509-
require.Error(t, err)
510-
require.Equal(t, "catalog configuration file field validation failed: \nCatalog test-catalog:\n - destination.baseImage must not be an empty string\n - destination.workingDir must not be an empty string\n", err.Error())
511-
},
512-
},
492+
// {
493+
// name: "BaseImage+WorkingDir invalid",
494+
// catalogs: []Catalog{
495+
// {
496+
// Name: "test-catalog",
497+
// Destination: CatalogDestination{},
498+
// Builders: []string{
499+
// BasicBuilderSchema,
500+
// },
501+
// },
502+
// },
503+
// assertions: func(t *testing.T, builderMap *CatalogBuilderMap, err error) {
504+
// require.Error(t, err)
505+
// require.Equal(t, "catalog configuration file field validation failed: \nCatalog test-catalog:\n - destination.baseImage must not be an empty string\n - destination.workingDir must not be an empty string\n", err.Error())
506+
// },
507+
// },
513508
}
514509

515510
for _, tc := range testCases {

alpha/template/composite/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ type Catalog struct {
3737
}
3838

3939
type CatalogDestination struct {
40-
BaseImage string
40+
// BaseImage string
4141
WorkingDir string
4242
}

0 commit comments

Comments
 (0)