Local Development
Build images
Build CNI operator
-
Set
IMAGE_REGISTRY
andVERSION
environment to target image repository for operatorexport IMAGE_REGISTRY=<registry> export VERSION=<version>
-
For private image registry, follow these additional steps to add image-pulling secret
-
Put your secret for pulling operator image (
operator-secret.yaml
) to the secret foldermv operator-secret.yaml config/secret
-
Run script to update relevant kustomization files
export OPERATOR_SECRET_NAME=$(cat config/secret/operator-secret.yaml|yq .metadata.name) make operator-secret
-
-
Build and push operator image
go mod tidy make docker-build docker-push
-
Build and push bundle image (optional)
make bundle make bundle-build bundle-push
To test the bundle, run
operator-sdk run bundle ${IMAGE_REGISTRY}/multi-nic-cni-bundle:v${VERSION}
Build CNI daemon
-
Set
IMAGE_REGISTRY
andVERSION
environment to target image repository for daemonexport IMAGE_REGISTRY=<registry> export VERSION=<version>
-
For private image registry, follow these additional steps to add image-pulling secret
-
Put your secret for pulling daemon image (
daemon-secret.yaml
) to the secret foldermv daemon-secret.yaml config/secret
-
Run script to update relevant kustomization files
export DAEMON_SECRET_NAME=$(cat config/secret/daemon-secret.yaml|yq .metadata.name) make daemon-secret
-
-
Build and push daemon image
# build environment: # Linux systems with netlink library cd daemon go mod tidy make docker-build-push
This will also build the cni binary and copy the built binary to daemon component.
Test
# test golang linter (available after v1.0.4)
make golint
# test controller
make test
# test daemon (available after v1.0.3)
make test-daemon
Install operator
make deploy
Uninstall operator
make undeploy