Skip to content

Instantly share code, notes, and snippets.

@fmount
Created February 27, 2023 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmount/f98b6b9cff60e0ad09e0ae770f6647a8 to your computer and use it in GitHub Desktop.
Save fmount/f98b6b9cff60e0ad09e0ae770f6647a8 to your computer and use it in GitHub Desktop.
Manila operator OLM pattern
## OLM PATTERN
Prereq:
* Login to quay.io
* Export USER and IMG
e.g.
> env | grep USE
USER=fpantano
> env | grep IMG
IMG=quay.io/fpantano/manila-operator:latest
* Build the operator
make docker-build
make docker-push
* Create the BUNDLE
make bundle
make bundle-build
make bundle-push
* Test the bundle locally
`operator-sdk bundle validate ./bundle`
or, validate the bundle against the image:
```
operator-sdk bundle validate quay.io/fpantano/manila-operator-bundle:v0.0.1
INFO[0000] Unpacking image layers
INFO[0000] running /sbin/docker pull quay.io/fpantano/manila-operator-bundle:v0.0.1
INFO[0002] running docker create
INFO[0002] running docker cp
INFO[0003] running docker rm
INFO[0003] All validation tests have completed successfully
```
* Run the operator using the bundle created before:
`operator-sdk run bundle quay.io/fpantano/manila-operator-bundle:v0.0.1`
It will create a local catalog and run the operator bundle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment