Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update community operator release doc #507

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 78 additions & 6 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Run the following command to generate the release bundle:
```
make bundle CHANNELS=alpha,beta DEFAULT_CHANNEL=beta
```
This will generate a new `<release-version>` bundle inside of the `koku-metrics-operator` directory within the repository.
This will generate a new bundle inside of the `bundle/` directory within the repository.

Once the release bundle has been generated, fork & clone the [community-operators-prod repository](https://github.com/redhat-openshift-ecosystem/community-operators-prod/tree/main). Create a branch, and copy the generated bundle to the `community-operators-prod/operators/koku-metrics-operator/` directory in your cloned fork.
Once the release bundle has been generated, fork & clone the [community-operators-prod repository](https://github.com/redhat-openshift-ecosystem/community-operators-prod/tree/main). Create a branch, and copy the generated bundle to the `community-operators-prod/operators/koku-metrics-operator/<VERSION>/` directory in your cloned fork.

For example, if the bundle was generated for a `1.0.0` release, the directory structure would look like the following:

Expand All @@ -39,22 +39,94 @@ koku-metrics-operator/
│ │ └── koku-metrics-operator.clusterserviceversion.yaml
│ ├── metadata
│ │ └── annotations.yaml
│ └── Dockerfile
├── 1.0.0
│ ├── manifests
│ │ ├── koku-metrics-cfg.v1.0.0.openshift.io_kokumetricsconfigs.yaml
│ │ └── koku-metrics-operator.v1.0.0.clusterserviceversion.yaml
│ ├── metadata
│ │ └── annotations.yaml
│ └── Dockerfile
```

### Create the release pull-request
### Create the operator-bundle pull-request
Commit, sign, and push the branch to the fork of the community-operators repo. Once pushed, open a PR against the community-operators repo and fill out the resulting checklist:

```
git commit -s -m "<commit-message>"
git push origin branch
```

After completing the above steps, bump the version in the Makefile (e.g. `VERSION ?= <release-version>+1`). This will prevent accidental builds and pushes for a version that has already been released. The generated release bundle and the bumped Makefile version should be committed to the `koku-metrics-operator` repo.
Example PR: [redhat-openshift-ecosystem/community-operators-prod#5587](https://github.com/redhat-openshift-ecosystem/community-operators-prod/pull/5587)

Once this PR merges, a pipeline will kick off to generate the bundle. When the bundle is generated, the FBC needs to be updated to push out a release.

### Update the File Based Catalog (FBC)

A few make commands are available in the community-operators koku-metrics-operator directory. First, update the version at the top of the file:
```
PREVIOUS_VERSION ?= 3.3.1
VERSION ?= 3.3.2
```

The gather the new bundle pullspec. The following command will pull the latest bundle for the defined `VERSION` and output the sha of the pullspec:

```
$ make get-bundle
docker pull quay.io/community-operator-pipeline-prod/koku-metrics-operator:3.3.2
3.3.2: Pulling from community-operator-pipeline-prod/koku-metrics-operator
Digest: sha256:9114f72f6adca60e18616786019d680883bb1c1dc88d317e7adeeec787054469
Status: Image is up to date for quay.io/community-operator-pipeline-prod/koku-metrics-operator:3.3.2
quay.io/community-operator-pipeline-prod/koku-metrics-operator:3.3.2
docker inspect --format '{{.RepoDigests}}' quay.io/community-operator-pipeline-prod/koku-metrics-operator:3.3.2
[quay.io/community-operator-pipeline-prod/koku-metrics-operator@sha256:9114f72f6adca60e18616786019d680883bb1c1dc88d317e7adeeec787054469] <<<<
```

Copy the `PULLSPEC` and update the value in the Makefile:
```
PULLSPEC ?= quay.io/community-operator-pipeline-prod/koku-metrics-operator@sha256:9114f72f6adca60e18616786019d680883bb1c1dc88d317e7adeeec787054469
```

Then add the new version to the catalog template:
```
make add-new-version
```

Inspect the template to ensure the `name` and `replaces` are correct for both the `alpha` and `beta` channels, and ensure the `olm.bundle` image has been added:
```
...
- name: koku-metrics-operator.v3.3.1
replaces: koku-metrics-operator.v3.3.0
- name: koku-metrics-operator.v3.3.2 <<<<
replaces: koku-metrics-operator.v3.3.1 <<<<
name: alpha
...
- name: koku-metrics-operator.v3.3.1
replaces: koku-metrics-operator.v3.3.0
- name: koku-metrics-operator.v3.3.2 <<<<
replaces: koku-metrics-operator.v3.3.1 <<<<
name: beta
...
- image: quay.io/community-operator-pipeline-prod/koku-metrics-operator@sha256:5c501ae285fe463608c4a2ca2d58bd9bb96b8faee7caef1076eee607eeaeb664
schema: olm.bundle
- image: quay.io/community-operator-pipeline-prod/koku-metrics-operator@sha256:9114f72f6adca60e18616786019d680883bb1c1dc88d317e7adeeec787054469 <<<<
schema: olm.bundle <<<<
schema: olm.template.basic
```

Next, create and validate the catalogs:
```
$ make catalogs

...
v4.12 catalog validation passed
v4.13 catalog validation passed
v4.14 catalog validation passed
v4.15 catalog validation passed
v4.16 catalog validation passed
v4.17 catalog validation passed
```

Finally, create a PR in the community-operators-prod repo with the Makefile, catalog template, and catalogs changed above.

Example PR: [redhat-openshift-ecosystem/community-operators-prod#5588](https://github.com/redhat-openshift-ecosystem/community-operators-prod/pull/5588)

Once this PR is merged and the pipeline runs on the merged commit, the latest version of the operator will become available.