You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generate csv: replace config with CSV and package manifest generators
internal/generate/olm-catalog: implement CSV and package manifest
generators, moving most of the code from internal/scaffold/olm-catalog
verbatim. Also removed CSV config
doc: remove CSVConfig documentation, update CLI docs
Co-authored-by: Eric Stroczynski <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,16 @@
5
5
- Add a new option to set the minimum log level that triggers stack trace generation in logs (`--zap-stacktrace-level`) ([#2319](https://github.com/operator-framework/operator-sdk/pull/2319))
6
6
- Added `pkg/status` with several new types and interfaces that can be used in `Status` structs to simplify handling of [status conditions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties). ([#1143](https://github.com/operator-framework/operator-sdk/pull/1143))
7
7
- Added support for relative Ansible roles and playbooks paths in the Ansible operator's file. ([#2273](https://github.com/operator-framework/operator-sdk/pull/2273))
8
+
- Added the [`generate csv --include`](doc/cli/operator-sdk_generate_csv.md#options) option to include files as input to the CSV generator in lieu of a config. ([#2249](https://github.com/operator-framework/operator-sdk/pull/2249))
8
9
9
10
### Changed
10
11
11
12
### Deprecated
12
13
13
14
### Removed
14
15
16
+
-**Breaking Change:** Removed CSV configuration file support (defaulting to deploy/olm-catalog/csv-config.yaml) in favor of including files as input to the generator using [`generate csv --include`](doc/cli/operator-sdk_generate_csv.md#options), defaulting to the `deploy/` directory. ([#2249](https://github.com/operator-framework/operator-sdk/pull/2249))
17
+
15
18
### Bug Fixes
16
19
17
20
- Fixed issue with Go dependencies caused by removed tag in `openshift/api` repository ([#2466](https://github.com/operator-framework/operator-sdk/issues/2466))
--csv-channel string Channel the CSV should be registered under in the package manifest
24
-
--csv-config string Path to CSV config file. Defaults to deploy/olm-catalog/csv-config.yaml
25
22
--csv-version string Semantic version of the CSV
26
23
--default-channel Use the channel passed to --csv-channel as the package manifests' default channel. Only valid when --csv-channel is set
27
24
--from-version string Semantic version of an existing CSV to use as a base
28
25
-h, --help help for csv
26
+
--include strings Paths to include in CSV generation, ex. "deploy/prod,deploy/test". If this flag is set and you want to enable default behavior, you must include "deploy/" in the argument list (default [deploy])
29
27
--operator-name string Operator name to use while generating CSV
28
+
--output-dir string Base directory to output generated CSV. The resulting CSV bundle directory will be "<output-dir>/olm-catalog/<operator-name>/<csv-version>" (default "deploy")
30
29
--update-crds Update CRD manifests in deploy/{operator-name}/{csv-version} the using latest API's
Copy file name to clipboardExpand all lines: doc/user/olm-catalog/generating-a-csv.md
+4-24Lines changed: 4 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -13,40 +13,20 @@ This document describes how to manage the following lifecycle for your Operator
13
13
Operator SDK projects have an expected [project layout][doc-project-layout]. In particular, a few manifests are expected to be present in the `deploy` directory:
`generate csv` reads these files and adds their data to a CSV in an alternate form.
21
-
22
-
The following example config containing default values should be copied and written to `deploy/olm-catalog/csv-config.yaml`:
23
-
24
-
```yaml
25
-
crd-cr-paths:
26
-
- deploy/crds
27
-
operator-path: deploy/operator.yaml
28
-
role-paths:
29
-
- deploy/role.yaml
30
-
```
31
-
32
-
Explanation of all config fields:
33
-
34
-
- `crd-cr-paths`: list of strings - a list of CRD and CR manifest file/directory paths. Defaults to `[deploy/crds]`.
35
-
- `operator-path`: string - the operator `Deployment` manifest file path. Defaults to `deploy/operator.yaml`.
36
-
- `role-paths`: list of strings - Role and ClusterRole manifest file paths. Defaults to `[deploy/role.yaml]`.
37
-
- `operator-name`: string - the name used to create the CSV and manifest file names. Defaults to the project's name.
38
-
39
-
**Note**: The [design doc][doc-csv-design] has outdated field information which should not be referenced.
40
-
41
-
Fields in this config file can be modified to point towards alternate manifest locations, and passed to `generate csv --csv-config=<path>` 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]`. `generate csv` will then ignore `deploy/crds/test` when getting CR/CRD data.
21
+
`generate csv` extracts manifests from files in `deploy/` by default that match the kinds above and adds them to the CSV. If your manifest files are not in `deploy/`, you can use the `--include=[list of paths]` option to instruct the command to extract manifests from files at those paths, ex. `--include="deploy/prod,deploy/test"`. Setting `--include` overrides default behavior; if you still want default behavior, you must append `deploy/` to the list of paths passed to `--include`.
42
22
43
23
## Versioning
44
24
45
25
CSV's are versioned in path, file name, and in their `metadata.name` field. For example, running `operator-sdk generate csv --csv-version 0.0.1` will generate a CSV at `deploy/olm-catalog/<operator-name>/0.0.1/<operator-name>.v0.0.1.clusterserviceversion.yaml`. A versioned directory such as `deploy/olm-catalog/<operator-name>/0.0.1` is known as a [*bundle*][doc-bundle]. Versions allow the OLM to upgrade or downgrade your Operator at runtime, i.e. in a cluster. A valid semantic version is required.
46
26
47
27
`generate csv` allows you to upgrade your CSV using the `--from-version` flag. If you have an existing CSV with version `0.0.1` and want to write a new version `0.0.2`, you can run `operator-sdk generate csv --csv-version 0.0.2 --from-version 0.0.1`. This will write a new CSV manifest to `deploy/olm-catalog/<operator-name>/0.0.2/<operator-name>.v0.0.2.clusterserviceversion.yaml` containing user-defined data from `0.0.1` and any modifications you've made to `roles.yaml`, `operator.yaml`, CR's, or CRD's.
48
28
49
-
The SDK can manage CRD's in your Operator bundle as well. You can pass the `--update-crds` flag to `generate csv` to add or update your CRD's in your bundle by copying manifests pointed to by `crd-cr-paths` in your config. CRD's in a bundle are not updated by default.
29
+
The SDK can manage CRD's in your Operator bundle as well. You can pass the `--update-crds` flag to `generate csv` to add or update your CRD's in your bundle by copying manifests in `deploy/crds` to your bundle. CRD's in a bundle are not updated by default.
0 commit comments