Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 3.58 KB

contribute.md

File metadata and controls

50 lines (30 loc) · 3.58 KB

Contributor's Guide

Software Requirements

In order to contribute on the nsm operator project make sure you have the minimal software requirements below:

Developing and Debugging

This source code can be run basically in two ways:

1 - Running make run, which executes go run behind the scenes and will rely on logs and error messages for debugging. With that the operator will run from the developer's machine and communicate externally with the Kubeapi-server endpoint.

2- By using the debug and run from VSCode. With the main.go file in focus you can hit F5 and trigger the VSCode debugger that has other features such as breakpoints and variable watches. For that you will need the golang extension installed in your environment. We do recommend to use VSCode but it's not mandatory. Any golang environment should work just fine. Check the VSCode debug page for more information.

Building the operator

First in the make file we need to setup two variables according to the needs:

IMG - for the registry where the operator image will be stored. It needs to have all the path in the string plus the tag.

BUILDER - is the container builder that can be podman or docker.

The project has a few make targets available for building:

make build - Will generate a binary file under a bin directory with the controller, manager and all the added reconcilers and types involved. That's the operator itself.

make container-build - Will generate the container image that runs the operator inside the cluster as a platform component.

make container-push - Will push the operator

With the container image available in a registry and that registry edited in the makefile the make deploy command can be run in order to deploy that container with all the necessary manifests to the cluster. From that point you should have your dev version running on a pod in the nsm namespace. Then follow the example on the README file to test with the other resources.

Resources to learn more about operators