Skip to content

Instantly share code, notes, and snippets.

@fmount
Last active March 7, 2023 17:00
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/1837ffbb757aee562a1ca62f0727eca3 to your computer and use it in GitHub Desktop.
Save fmount/1837ffbb757aee562a1ca62f0727eca3 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.

If you want to use an -index image instead of running a local catalog:

make catalog-build
make catalog-push

which build and pushes the index image to the registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment