make minishift-start
eval $(minishift docker-env)
make test-e2e-local
If you are using OpenShift 3, install OLM with this command:
oc create -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml
NOTE: Alternately you can use
oc
command instead ofkubectl.
Note: Instead of a public registry, the registry provided by OpenShift might work.
Checkout the master
branch of devconsole-operator
Then run these commands:
$ operator-sdk build quay.io/<username>/devconsole-operator
$ docker login -u <username> -p <password> quay.io
$ docker push quay.io/<username>/devconsole-operator
NOTE: make your repo public When running the above command, substitute the
username
andpassword
entries appropriately.
Open this file
manifests/devconsole/0.1.0/devconsole-operator.v0.1.0.clusterserviceversion.yaml
and change the image to point to the location pushed in the previous step.
Inside the file look for image: REPLACE_IMAGE
and specify the image location.
Now you are going to build the operator image using Dockerfile.registry
docker build -f Dockerfile.registry . -t quay.io/<username>/operator-registry:0.1.0 \
--build-arg image=quay.io/<username>/devconsole-operator --build-arg version=0.1.0
docker push quay.io/<username>/operator-registry:0.1.0
When running the above command, substitute the username
with your quay.io username.
Use this template to create a YAML file, say cat-sub.yaml
:
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: my-catalog
namespace: olm
spec:
sourceType: grpc
image: quay.io/<username>/operator-registry:0.1.0
displayName: Community Operators
publisher: Red Hat
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: my-devconsole
namespace: operators
spec:
channel: alpha
name: devconsole
source: my-catalog
sourceNamespace: olm
Before applying the above file, point to the newly created operator registry image (substitute the username
with your quay.io username).
Example:
oc apply -f cat-sub.yaml
Check for the existence of a Custom Resource Definitions with the name as gitsources.devconsole.openshift.io
Run this command to list CRDs:
oc get crds