⚠⚠⚠ THIS IS A LIVING DOCUMENT AND LIKELY TO CHANGE QUICKLY ⚠⚠⚠
These instructions have been tested on Fedora 39.
Most changes you'll want to test live against a real cluster. Instructions are TODO.
Go v1.21 is used for development of the NTO.
Static analysis (e.g. gofmt) can be executed with:
make verify
Unit tests (that don't interact with a running cluster) can be executed with:
make test-unit
Local end-to-end tests (that don't interact with a running cluster) can be executed with:
make test-e2e-local
Note: This will install ginkgo if it is not already installed. You must ensure that the go bin directory (usually $HOME/go/bin) is in your $PATH.
During NTO development there are certain test scenarios that require a cluster to properly test your code.
In those situations, you will need to:
- Build the NTO image you're interested in testing
- Push the image to an OpenShift cluster
To build the repo's code as an image and push it to the cluster we have a script that can automate this for you:
ORG=quay-user hack/deploy-custom-nto.sh
It is also possible to opt for a specific revision of TuneD by specifying: TUNED_COMMIT=commit-hash
We recommend running some e2e tests to verify the custom image works as expected.
By default the build will compile using the architecture the system is currently using.
You can specify a cross compiling architecture by setting GOARCH
in your environment.
For example, to cross-compile for the aarch64 architecture, use the following:
GOARCH=arm64 make build
For QEMU user mode emulation, make sure you have the appropriate static binaries installed. For aarch64 builds above on Fedora, the package is qemu-user-static-aarch64.
To cross-compile for x86_64 architecture (e.g. from Apple's M hardware), use the following:
GOARCH=amd64 make build
By default the image tag is generated using the name of the local git branch. This behaviour will cause error 125 if you have a special character in your local git branch name. You should specify a tag manually instead:
TAG=my-custom-tag make local-image