This is a living document containing suggestions for testing Router changes on an existing cluster. These "hacks" are not officially supported and are subject to change, break, etc.
To build the Router binary, run:
$ make
- An OpenShift cluster
- An admin-scoped
KUBECONFIG
for the cluster. - Install imagebuilder
To test Router changes on an available cluster, utilize Dockerfile.debug
and
Makefile.debug
in hack/
.
Dockerfile.debug
is a multi-stage dockerifle for building the Router binary,
as well as the Router image itself. The outputted image uses centos:8
as it's base
since installing packages on an OpenShift RHEL base image requires RHEL entitlements.
Makefile.debug
contains simple commands for "hot-swapping" the Router image running
in an IngressController deployment.
Example:
- Run
make
to ensure that your code changes compile - Set the
IMAGE
environment variable. (ie.export IMAGE=<your-quay-username>/openshift-router
) - Build a modified Router image for testing your changes (
make -f hack/Makefile.debug new-openshift-router-image
) - Push the new Router image to quay.io (
make -f hack/Makefile.debug push
) - Use the new Router image in the default Ingress Controller's deployment (
make -f hack/Makefile.debug set-image
)
Alternatively, after setting IMAGE
, you can run make dwim
(do what I mean) to accomplish the above steps in one command.
When done testing, use make -f hack/Makefile.debug reset
to re-enable the CVO and Ingress Operator.
Run unit tests:
$ make check