Skip to content

Latest commit

 

History

History
105 lines (70 loc) · 2.23 KB

DEVELOPMENT.md

File metadata and controls

105 lines (70 loc) · 2.23 KB

Development

This document describes the process for build, running and testing this application locally.

Building

Installing operator-sdk

This project is built using operator-sdk. There is a hard dependency on version 1.4.2 at the time of writing.

Note

Due to this controller-gen issue the steps below cannot be built using Go 1.22.x.

Note

For macOS users on arm64 you may need to build the binary from source using the steps below.

Firstly, remove any existing operator-sdk binary from your $PATH.

To build the operator-sdk from source, run:

git clone https://github.com/operator-framework/operator-sdk
cd operator-sdk
git fetch origin --tags
git checkout v1.4.2
make install

To install the operator-sdk and kustomize, run:

make install-build-deps

Any dependencies that already exist will be skipped.

Building the bundle

To generate and validate bundle manifests and metadata run:

make bundle

Building the binary

To build the binary, run:

make build

Building the image

To build the image, which requires access to Red Hat CI registry, run:

make docker-build

E2E Testing

Note

For macOS users, you will need to install gsed using brew install gnu-sed

Running in KinD

Firstly, bring up the environment:

make mco-kind-env

This will create a cluster with MCO installed and the operator running.

Then, run the tests:

make e2e-tests-in-kind

By default, if the tests fail, the ACM components will be removed. We can bypass this behaviour by running:

SKIP_UNINSTALL_STEP=true make e2e-tests-in-kind

Likewise, we can also bypass the environment setup by running:

SKIP_INSTALL_STEP=true make e2e-tests-in-kind

After running the tests, there will be some changes made to your environment. We can clean up the environment by running:

rm "examples/mco/e2e/v1beta1/observability.yaml-e" || true
rm "examples/mco/e2e/v1beta2/observability.yaml-e" || true
rm "operators/multiclusterobservability/manifests/base/grafana/deployment.yaml-e" || true
git stash