Skip to content

Commit

Permalink
bundle migration (#67)
Browse files Browse the repository at this point in the history
* Migrate latest CSV to manifests directory

Migrate latest CSV to manifests directory in preparation for migrating to the
bundle release format vs the application registry approach. Update the operator.yaml
which was out of sync with the latest CSV.

Latest CSV has been updated to sync with the operator.yaml which has the current
container image tags applied to the CSV which was incorrect.

* Create initial bundle

* Update Travis-CI to check bundle validation

* No automatic releases for right now

* Add new README.md for release process

* Be verbose when checking bundle validation

* Update build/README.md for validation command

* Smart Gateway Operator v2.0.1 is the base release

Remove the replaces line from the CSV to start our base release for bundles as
the most current release. From here we will create new CSVs that will replace
starting at v2.0.1 rather than having to import all the historical CSVs which
are not used by anyone.
  • Loading branch information
leifmadsen authored Oct 1, 2020
1 parent 4d537c3 commit bd229cd
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 2,503 deletions.
18 changes: 14 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
env:
global:
- RELEASE_VERSION: v0.17.2
- secure: MeO4V6CHY8GjebH1n3sTYtq5AG/ohY4MgKr4pDb0P29DxpAtYaqa+lkVBB3lxXGcsE2yY8bEOmHHzA6CQgYpWGHOGihKJbL40HQdQGAajtCStSQcv+AVA4Dq5uwo714Ddx7wovntJbm+zO+Cyv2zczj6407fTvuyJAjf9MMrCkwC23tLr+iCld+juSQlfOtdExzgIegWEhi3z967i9ce70ux4jl9n3jHXaU/6A/o6gJS/Ng5INf8VJ0ZZKnCUwdHYOshjzQAbC+ym24W4oGQTdyJbVAIbxdJMl65VI/h3xcTeS8PJXw9PK9lTS7r7RUDdl8giLTk67TgpYFE/LhuYiq+zAH/5iZSD/Mr0tyblHlpqB9gzDUs2G00IYv7l/RD+BFwReZAXxR9xO2Rsxumtsf+mKm2iu6BkbuzNTudyR2vn4dMGp1lwWwY44ll22nMaek2fjNhgQwB6Ps0xU19NrwpiS7AdyYnYGi9Cg8n59XT5ydwL83jITDk43tZd0IZjX6TcssshqQBzCeXovyzD3O4PsfkBkPer5xoRJ0e/qLLFkQxrv4YNtqxtNzzX9Z3dpYhV0s1sw+ydLTz4/HIMu9tFLkV8F4Zf8r5Yd8NSSKV1E+o8QIXRPATxpJ2OlwG2PiCl7BgYihx8TWXtjnSLDPVJHofw/XAS391DikixRk=
- secure: IZqzqdEL37CHF3NWEx3jNegfrl9092wpWWezEY4oEVNY1ncUUbZdmzq97gTLtOZ/5lkvm9yMOXZzM20NAl898U8jXp8oj1rX+JowXrXNG7celNIiwag+R9uELOwhSwPkLBF/swmdWf4gErTmFpxIJCERGV9aIuodXd5Wie7U45qn6OExVVp6U4S0VeucOH/SIDDk7V5k4Aaw4MTfNy9Dq6SgMkIxhMhro3Ghxz0NqrZf9BXnrWMxqVIhene7fYrmOvbi1vRrEhgoIROn8mNHD/92sIBEGTQ774lOsX7IMAzXZBH6XeuSLhnH6EZRq0us/evc9c1h8NAIbo4id8x3D4olGWge04PbBoR5hegQLJR4r8Wi0oqGEmiVHb5Uunr1OAjgD9n/ZekeYiUIrt1CLhhNjlTOr4+JW0Ny6X26HuouOG+cIRfKIDtFQjisMLUHgRSFBEqMHrd1ROzekBCFk7MnfSMUq55z176BTnQgGqp+2PFZHI8/Lbh2LhkBfQ477BHieT27nZUbMV3KMyQzrR8SJFTa1p19hqf4Dx9PE1CRe5OzrpzOtYiKwk0RRNKHvrkooPzaojMft0Gj1snweAC4Gipzqs//aTNRZA2jR7RIGsmZsGW+RxDesFyckgCqB0p2kBup/9AnPvS6hLSQQA4BqE4T51UHELi0/Ar/pHA=

os: linux
language: python

services:
- docker

git:
depth: 1

before_install:
- curl --output operator-sdk -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk-$RELEASE_VERSION-x86_64-linux-gnu
- chmod +x operator-sdk
- sudo mv operator-sdk /usr/local/bin

install:
- pip install operator-courier==2.1.7
- pip install ansible-lint

script:
- operator-courier verify --ui_validate_io deploy/olm-catalog/smart-gateway-operator
- ansible-lint roles/smartgateway/
after_success:
- if [ "$TRAVIS_TAG" == "" ]; then echo "Not a tagged release, skipping after_success.sh"; else ./build/travis/after_success.sh; fi
- operator-sdk bundle validate --verbose ./deploy/olm-catalog/smart-gateway-operator
72 changes: 72 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Updating CSV for next bundle release

The following set of commands will allow updating the current CSV to a new
version.

## Prerequisites

You will need operator-sdk 0.17.2 (in sync with OCP 4.5).

```
curl --output operator-sdk -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk-$RELEASE_VERSION-x86_64-linux-gnu
chmod +x operator-sdk
mkdir -p ~/.local/bin
mv operator-sdk ~/.local/bin
```

## Creating a new release

Creating a new release requires 3 steps:

* update container image versions to deploy in `deploy/operator.yaml`
* generate a new CSV version
* create a new bundle image and push to quay.io/infrawatch-operators

### Updating container image tags

Update the `deploy/operator.yaml` file to target a new set of container image
tags. You will need to adjust the `smart-gateway-operator` version which should
align to the new CSV version. Optionally, update the related container images
for `smart-gateway`, `sg-core` and `sg-bridge` if there are new container
images that should be associated with this CSV release.

If there are any roles, role binding, or deployment adjustments for this
release, now is the time to make those changes. See files in the `deploy/`
root.

The following environment variables are used by the Operator to determine what
components to deploy into the environment. Set the container image tags
appropriately.

```
- name: SMARTGATEWAY_IMAGE
value: quay.io/infrawatch/smart-gateway:v2.0.0
- name: CORE_SMARTGATEWAY_IMAGE
value: quay.io/infrawatch/sg-core:v3.0.0
- name: BRIDGE_SMARTGATEWAY_IMAGE
value: quay.io/infrawatch/sg-bridge:v1.0.0
```

### Updating the CSV manifests

To update the CSV manifests to a new release version use `operator-sdk
generate csv` and pass the new version. The `replaces` line will be
automatically updated.

```
operator-sdk generate csv --csv-version 2.1.0
```

## Create a new bundle container image

Create a new bundle release by updating the bundle container image.

```
operator-sdk bundle create quay.io/infrawatch-operators/smart-gateway-operator-bundle:v2.1.0
```

You can validate your bundle directory with `operator-sdk bundle validate`.

```
operator-sdk bundle validate ./deploy/olm-catalog/smart-gateway-operator
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LABEL operators.operatorframework.io.bundle.package.v1=smart-gateway-operator
LABEL operators.operatorframework.io.bundle.channels.v1=stable
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable

COPY /*.yaml /manifests/
COPY /metadata/annotations.yaml /metadata/annotations.yaml
COPY deploy/olm-catalog/smart-gateway-operator/manifests /manifests/
COPY deploy/olm-catalog/smart-gateway-operator/metadata/annotations.yaml /metadata/annotations.yaml
Loading

0 comments on commit bd229cd

Please sign in to comment.