From b4d1991c1f5613904650be0ca1743d2b4ea7cc5a Mon Sep 17 00:00:00 2001 From: Nahshon Unna-Tsameret Date: Wed, 14 Apr 2021 08:33:04 +0300 Subject: [PATCH] Remove the relatedImages field from the CRD CRD should not contain the relatedImages field. Signed-off-by: Nahshon Unna-Tsameret --- hack/csv-generator.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/csv-generator.go b/hack/csv-generator.go index 7a53eacf2..c1b089a30 100644 --- a/hack/csv-generator.go +++ b/hack/csv-generator.go @@ -146,7 +146,7 @@ func runGenerator() error { return err } - err = marshallObject(crd, relatedImages, os.Stdout) + err = marshallObject(crd, nil, os.Stdout) if err != nil { return err } @@ -327,7 +327,9 @@ func marshallObject(obj interface{}, relatedImages []interface{}, writer io.Writ unstructured.SetNestedSlice(r.Object, deployments, "spec", "install", "spec", "deployments") } - unstructured.SetNestedSlice(r.Object, relatedImages, "spec", "relatedImages") + if len(relatedImages) > 0 { + unstructured.SetNestedSlice(r.Object, relatedImages, "spec", "relatedImages") + } jsonBytes, err = json.Marshal(r.Object) if err != nil {