/toolchain-operator

CodeReady Toolchain Operator

Primary LanguageGoApache License 2.0Apache-2.0

CodeReady Toolchain Operator

Go Report Card GoDoc Codecov.io

Build

Requires Go version 1.12.6 - download for your development environment here.

This repository uses Go modules. You may need to export GO111MODULE=on to turn modules support "on".

Development

To run this operator locally you need to have at least one Minishift profile started:

$ minishift start

Then you can run the operator locally with the help of operator-sdk (you need version v0.10.0 or higher):

$ make up-local

That Makefile target takes care of additional several steps which can be executed separately:

  • logging as system:admin user: $ make login-as-admin

  • creating local test namespace: $ make create-namespace

  • deploy CRDs: $ make deploy-crd

  • building the project: $ make build

  • deploying ClusterRole/ClusterRoleBinding and creating ServiceAccount: $ make deploy-rbac

There are a few more targets that you can find useful:

  • to login as system:admin user and enter the local test namespace: $ make use-namespace

  • to remove the local test namespace: $ make clean-namespace

  • to remove & create the local test namespace, and create ClusterRole/ClusterRoleBinding and ServiceAccount inside of the namespace: $ make reset-namespace

End-to-End tests

TBD

Verifying the OpenShift CI configuration

It's possible to verify the OpenShift CI config from the developer's laptop while all the jobs are executed on the remote, online CI platform:
  1. checkout and build the CI Operator command line tool

  2. login to https://console.svc.ci.openshift.org (via GH OAuth) and copy the login command (you may need to switch to the application console)

  3. login with the command aferementioned

  4. run the CI jobs with

    ci-operator --config ../../openshift/release/ci-operator/config/codeready-toolchain/toolchain-operator/codeready-toolchain-toolchain-operator-master.yaml --git-ref=codeready-toolchain/toolchain-operator@master

assuming that the OpenShift Release repo was checked you.

Note
you can ignore the RBAC issues that are displayed in the console