Run the CLI Manager in your OpenShift cluster to distribute CLIs.
This repository is compatible with the OpenShift Tests Extension (OTE) framework.
make build# Run a specific test suite or test
./cli-manager-operator-tests-ext run-suite openshift/cli-manager-operator/all
./cli-manager-operator-tests-ext run-test "test-name"
# Run with JUnit output
./cli-manager-operator-tests-ext run-suite openshift/cli-manager-operator/all --junit-path "${ARTIFACT_DIR}/junit.xml"# List all test suites
./cli-manager-operator-tests-ext list suites
# List tests in a suite
./cli-manager-operator-tests-ext list tests --suite=openshift/cli-manager-operator/allFor more information about the OTE framework, see the openshift-tests-extension documentation.
- Build and push the operator image to a registry:
- Ensure the
imagespec indeploy/07_deployment.yamlrefers to the operator image you pushed - Run
oc create -f deploy/.
This process refers to building the operator in a way that it can be installed locally via the OperatorHub with a custom index image
-
Build and push the operator image to a registry:
export QUAY_USER=${your_quay_user_id} export IMAGE_TAG=${your_image_tag} podman build -t quay.io/${QUAY_USER}/openshift-cli-manager-operator:${IMAGE_TAG} -f Dockerfile podman login quay.io -u ${QUAY_USER} podman push quay.io/${QUAY_USER}/openshift-cli-manager-operator:${IMAGE_TAG}
-
Export your desired/current version:
export OPERATOR_VERSION=${your_version}
-
Update the
.spec.install.spec.deployments[0].spec.template.spec.containers[0].imagefield in the SSO CSV under./manifests/${OPERATOR_VERSION}/openshift-cli-manager-operator.v${OPERATOR_VERSION}.0.clusterserviceversion.yamlto point to the newly built image. -
build and push the metadata image to a registry (e.g. https://quay.io):
podman build -t quay.io/${QUAY_USER}/openshift-cli-manager-operator-metadata:${IMAGE_TAG} -f Dockerfile.metadata . podman push quay.io/${QUAY_USER}/openshift-cli-manager-metadata:${IMAGE_TAG}
-
build and push image index for operator-registry (pull and build https://github.com/operator-framework/operator-registry/ to get the
opmbinary)opm index add --bundles quay.io/${QUAY_USER}/openshift-cli-manager-operator-metadata:${IMAGE_TAG} --tag quay.io/${QUAY_USER}/openshift-cli-manager-operator-index:${IMAGE_TAG} podman push quay.io/${QUAY_USER}/openshift-cli-manager-operator-index:${IMAGE_TAG}
Don't forget to increase the number of open files, .e.g.
ulimit -n 100000in case the current limit is insufficient. -
create and apply catalogsource manifest (remember to change <<QUAY_USER>> and <<IMAGE_TAG>> to your own values):
apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: openshift-cli-manager-operator namespace: openshift-marketplace spec: sourceType: grpc image: quay.io/<<QUAY_USER>>/openshift-cli-manager-operator-index:<<IMAGE_TAG>>
-
create
openshift-cli-manager-operatornamespace:$ oc create ns openshift-cli-manager-operator -
open the console Operators -> OperatorHub, search for
CLI Manager operatorand install the operator