From fab84f86349e25b443ae95db82c1e8cb08cc9edc Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Mon, 28 Oct 2019 22:07:22 +0000 Subject: [PATCH 1/4] add warn for spec.icon in olm-catalog command --- CHANGELOG.md | 1 + internal/scaffold/olm-catalog/csv.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c1a36cdd7..bdd9d01583a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Added `Operator Version: X.Y.Z` information in the operator logs.([#1953](https://github.com/operator-framework/operator-sdk/pull/1953)) - Make Ansible verbosity configurable via the `ansible-verbosity` flag. ([#2087](https://github.com/operator-framework/operator-sdk/pull/2087)) +- Added warn for spec.icon OLM field when the CSV file is generated. ([#2095](https://github.com/operator-framework/operator-sdk/pull/2095)) ### Changed diff --git a/internal/scaffold/olm-catalog/csv.go b/internal/scaffold/olm-catalog/csv.go index 21d1f843ec7..2c59f1ce595 100644 --- a/internal/scaffold/olm-catalog/csv.go +++ b/internal/scaffold/olm-catalog/csv.go @@ -272,6 +272,9 @@ func getEmptyRequiredCSVFields(csv *olmapiv1alpha1.ClusterServiceVersion) (field if csv.Spec.Maturity == "" { fields = append(fields, "spec.maturity") } + if len(csv.Spec.Icon) == 0 { + fields = append(fields, "spec.icon") + } return fields } From 004d8357da43ed1ed0170b1365c7f4f21b117ddf Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Thu, 31 Oct 2019 21:17:38 +0000 Subject: [PATCH 2/4] add info in the docs --- doc/user/olm-catalog/generating-a-csv.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/user/olm-catalog/generating-a-csv.md b/doc/user/olm-catalog/generating-a-csv.md index 087620c56cd..4b53187cdfc 100644 --- a/doc/user/olm-catalog/generating-a-csv.md +++ b/doc/user/olm-catalog/generating-a-csv.md @@ -34,7 +34,7 @@ Explanation of all config fields: - `role-paths`: list of strings - Role and ClusterRole manifest file paths. Defaults to `[deploy/role.yaml]`. - `operator-name`: string - the name used to create the CSV and manifest file names. Defaults to the project's name. -**Note**: The [design doc][doc-csv-design] has outdated field information which should not be referenced. +**NOTE**: The [design doc][doc-csv-design] has outdated field information which should not be referenced. Fields in this config file can be modified to point towards alternate manifest locations, and passed to `gen-csv --csv-config=` to configure CSV generation. For example, if I have one set of production CR/CRD manifests under `deploy/crds/production`, and a set of test manifests under `deploy/crds/test`, and I only want to include production manifests in my CSV, I can set `crd-cr-paths: [deploy/crds/production]`. `gen-csv` will then ignore `deploy/crds/test` when getting CR/CRD data. @@ -59,12 +59,13 @@ INFO[0000] Required csv fields not filled in file deploy/olm-catalog/app-operato spec.keywords spec.maintainers spec.provider + spec.icon INFO[0000] Created deploy/olm-catalog/app-operator/0.0.1/app-operator.v0.0.1.clusterserviceversion.yaml ``` When running `gen-csv` with a version that already exists, the `Required csv fields...` info statement will become a warning, as these fields are useful for displaying your Operator in Operator Hub. -**Note:** `description`, `displayName`, `resources`, `specDescriptors`, `statusDescriptors`, `actionDescriptors` fields in each `spec.customresourcedefinitions.owned` element will not be filled by the CSV generator. These fields must be added manually. The SDK plans on using [code annotations][code-annotations] to populate these fields in the near future. +**NOTE:** `description`, `displayName`, `resources`, `specDescriptors`, `statusDescriptors`, `actionDescriptors` fields in each `spec.customresourcedefinitions.owned` element will not be filled by the CSV generator. These fields must be added manually. The SDK plans on using [code annotations][code-annotations] to populate these fields in the near future. ## Updating your CSV @@ -72,7 +73,7 @@ Let's say you added a new CRD `deploy/crds/group.domain.com_resource_crd.yaml` t The SDK will not overwrite user-defined fields like `spec.maintainers` or descriptions of CSV elements, with the exception of `specDescriptors[].displayName` and `statusDescriptors[].displayName` in `spec.customresourcedefinitions.owned`, as mentioned [above](#first-generation). -Including the `--update-crds` flag will update the CRD's in your Operator bundle. +**NOTE:** Including the `--update-crds` flag will update the CRD's in your Operator bundle. ## Upgrading your CSV @@ -93,6 +94,7 @@ Required: * `spec.displayName` _(user)_ : a name to display for the Operator in Operator Hub. * `spec.keywords` _(user)_ : a list of keywords describing the Operator. * `spec.maintainers` _(user)_ : a list of human or organizational entities maintaining the Operator, with a `name` and `email`. +* `spec.icon` _(user)_ : a Base64 encoded image. E.g `cat image.png | base64` or `base64 -w 0 image.jpg`. * `spec.provider` _(user)_ : the Operator provider, with a `name`; usually an organization. * `spec.labels` _(user)_ : a list of `key:value` pairs to be used by Operator internals. * `spec.version`: semantic version of the Operator, ex. `0.1.1`. From f3c442a15d54c22741394177899e7a6931cf32d6 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Thu, 31 Oct 2019 21:18:40 +0000 Subject: [PATCH 3/4] Update doc/user/olm-catalog/generating-a-csv.md --- doc/user/olm-catalog/generating-a-csv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/olm-catalog/generating-a-csv.md b/doc/user/olm-catalog/generating-a-csv.md index 4b53187cdfc..f07b1198cd0 100644 --- a/doc/user/olm-catalog/generating-a-csv.md +++ b/doc/user/olm-catalog/generating-a-csv.md @@ -59,7 +59,7 @@ INFO[0000] Required csv fields not filled in file deploy/olm-catalog/app-operato spec.keywords spec.maintainers spec.provider - spec.icon + spec.icon INFO[0000] Created deploy/olm-catalog/app-operator/0.0.1/app-operator.v0.0.1.clusterserviceversion.yaml ``` From b4beedebbbb71ab389604a4728521dd30faab0df Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Fri, 1 Nov 2019 13:40:30 +0000 Subject: [PATCH 4/4] Update CHANGELOG.md Co-Authored-By: Joe Lanford --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdd9d01583a..13852117e1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Added `Operator Version: X.Y.Z` information in the operator logs.([#1953](https://github.com/operator-framework/operator-sdk/pull/1953)) - Make Ansible verbosity configurable via the `ansible-verbosity` flag. ([#2087](https://github.com/operator-framework/operator-sdk/pull/2087)) -- Added warn for spec.icon OLM field when the CSV file is generated. ([#2095](https://github.com/operator-framework/operator-sdk/pull/2095)) +- Added a check for `spec.icon` when generating CSVs with `operator-sdk olm-catalog gen-csv`. ([#2095](https://github.com/operator-framework/operator-sdk/pull/2095)) ### Changed