# Build the operator binary
make build
# Build and push container image
make docker-build docker-push IMG=<registry>/operator:tag
# Cross-platform build (e.g., linux/amd64 from an ARM machine)
PLATFORMS=linux/amd64 make docker-buildx IMG=<registry>/operator:tagThere are three ways to run the operator for development and testing:
The operator runs as a local process on your machine, connecting to the cluster via your kubeconfig. No image build required — ideal for rapid development.
make install # install CRDs
make run # run operator locallyThe operator watches the cluster and reconciles resources. Stop with Ctrl+C. CRDs remain installed.
The operator runs as a pod inside the cluster. Requires building and pushing an image first.
make docker-build docker-push IMG=<registry>/operator:tag
make deploy IMG=<registry>/operator:tagUse TARGET_PLATFORM to select the platform overlay (see Platform Selection).
Tests the full OLM install path including the CSV, RBAC, and service configuration as end users would experience it.
make bundle IMG=<registry>/operator:tag
make bundle-build bundle-push BUNDLE_IMG=<registry>/operator-bundle:tag
operator-sdk run bundle <registry>/operator-bundle:tag --namespace openshift-rhtas-operator --timeout 5mThe operator's config/default/images.env references images from registry.redhat.io, which requires a Red Hat subscription and only contains released versions. During development, the latest builds from main are published to quay.io/securesign and can be used instead.
Switch all image references from registry.redhat.io/rhtas to quay.io/securesign:
make dev-imagesThis is a local modification that affects make run, make deploy, and make bundle. The transformation is defined in ci/dev-images.sed.
Note: Do not commit the modified
images.env. To revert:git checkout config/default/images.env.
Configure the cluster's container runtime to transparently redirect image pulls from registry.redhat.io to quay.io/securesign. No operator code changes are needed — the same digests exist in both registries.
- OpenShift — apply the
ImageDigestMirrorSet. The Machine Config Operator will propagate this to all nodes (may trigger a rolling reboot on older OpenShift versions):kubectl apply -f .tekton/images-mirror-set.yaml
- CRI-O — copy
ci/registries.confto/etc/containers/registries.conf.d/rhtas-dev-mirrors.confon each node and restart CRI-O. - containerd (e.g., EKS) — configure mirror hosts under
/etc/containerd/certs.d/. See the containerd hosts documentation for details.
| Method | Uninstall command |
|---|---|
Local run (make run) |
Ctrl+C to stop, then make uninstall to remove CRDs |
Kustomize (make deploy) |
make undeploy to remove all resources, make uninstall to remove CRDs |
| OLM bundle | operator-sdk cleanup rhtas-operator --namespace openshift-rhtas-operator |
After modifying API types in api/v1alpha1/*_types.go:
make manifests generateThis regenerates CRDs, RBAC manifests, and deepcopy methods.
# Unit tests
make test
# E2E tests (sequential, requires a running cluster)
go test -p 1 ./test/e2e/... -tags=integration -timeout 30m
go test -p 1 ./test/e2e/... -tags=upgrade -timeout 20m
go test -p 1 ./test/e2e/... -tags=ha -timeout 20m
go test -p 1 ./test/e2e/... -tags=custom_install -timeout 20mmake lint
make lint-fixThe TARGET_PLATFORM variable controls which kustomize overlay is used for deployment and bundle generation:
| Value | Description |
|---|---|
openshift (default) |
OpenShift overlay with service-serving-cert TLS, Prometheus RBAC, and ServiceMonitor with CA verification |
kubernetes |
Plain Kubernetes overlay with self-signed TLS and basic ServiceMonitor |
Usage:
# Deploy to OpenShift (default)
make deploy IMG=<registry>/operator:tag
# Deploy to Kubernetes
make deploy IMG=<registry>/operator:tag TARGET_PLATFORM=kubernetes
# Generate OpenShift bundle
make bundle IMG=<registry>/operator:tag
# Generate Kubernetes bundle
make bundle IMG=<registry>/operator:tag TARGET_PLATFORM=kubernetesBuild and push OLM bundle images:
make bundle IMG=<registry>/operator:tag
make bundle-build bundle-push BUNDLE_IMG=<registry>/operator-bundle:tagFor Kubernetes bundles, add TARGET_PLATFORM=kubernetes to all three commands.