Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 4.61 KB

README.md

File metadata and controls

62 lines (47 loc) · 4.61 KB

How to generate Operator Bundles for OpenShift

For OpenShift Platform release we generate the bundle for using local strategy.

Steps to generate bundles from an local files in the tree (warning: container images could be outdated, will need image replacement)

From the project root (tektoncd/operator) run

```bash
OPERATOR_RELEASE_VERSION=x.y.z
PREVIOUS_OPERATOR_RELEASE_VERSION=a.b.c
export BUNDLE_ARGS="--workspace openshift --operator-release-version ${OPERATOR_RELEASE_VERSION} --channels stable,preview --default-channel stable --fetch-strategy-local --upgrade-strategy-replaces --operator-release-previous-version ${PREVIOUS_OPERATOR_RELEASE_VERSION} --olm-skip-range '>=1.5.0 <1.6.0'"
make operator-bundle
```

CLI flags explained

Flag Description
--workspace operatorhub/openshift the working directory where the operator bundle should be assembled
--operator-release-version 1.6.0 version of the release (version of bundle)
--channels stable,preview target release channel(s) (eg: stable,preview)
--default-channel stable set default channel of the operator
--fetch-strategy-local gather input resources definitions from a local yaml files
--upgrade-strategy-replaces specify update strategy (use replaces or semver)
--operator-release-previous-version 1.5.0 version of the previous operator release that will be replaced by the bundle being built
--olm-skip-range '>=1.5.0 <1.6.0' add olm.skipRange to the CSV file in the bundle

Steps to generate bundles from an existing github release.yaml

Note: The input release.yaml could be a github release or the result of ko resolve config

  1. Make sure that we have the release manifest file ready eg:

    tektoncd_operator_version=$( curl -sL https://api.github.com/repos/tektoncd/operator/releases | jq  -r '.[].tag_name' | sort -Vr | head -n 1 | tr -d 'v')
    release_file_name=openshift-release-v${tektoncd_operator_version}.yaml
    curl -sL -o ${release_file_name} https://github.com/tektoncd/operator/releases/download/v${tektoncd_operator_version}/openshift-release.notags.yaml
  2. From the project root (tektoncd/operator) run (note abosolute path for --release-manifest flag is necessary)

    export BUNDLE_ARGS="--workspace openshift --operator-release-version ${tektoncd_operator_version} --channels alpha --default-channel alpha --fetch-strategy-release-manifest --release-manifest $(pwd)/${release_file_name} --upgrade-strategy-semver"
    make operator-bundle

    CLI flags explained

    Flag Description
    --workspace openshift the working directory (inside operatorhub/) where the operator bundle should be assembled
    --operator-release-version ${tektoncd_operator_version} version of the release (version of bundle)
    --channels alpha target release channel(s) (eg: stable,preview)
    --default-channel alpha set default channel of the operator
    --fetch-strategy-release-manifest gather input kubernetes resources from a list of yaml manifests instead of using local files
    --release-manifest $(pwd)/${release_file_name} specify abosolute ($(pwd)/${release_file_name}) path to release manifest file
    --upgrade-strategy-semver specify update strategy (options replaces or semver)