Skip to content

Commit

Permalink
Add run-local make target to run operator with telepresence
Browse files Browse the repository at this point in the history
  • Loading branch information
marun committed Apr 21, 2020
1 parent bce64ce commit 1a9a0ae
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
targets/openshift/deps-gomod.mk \
targets/openshift/images.mk \
targets/openshift/bindata.mk \
targets/openshift/operator/run-local.mk \
)

# Run core verification and all self contained tests.
Expand All @@ -27,6 +28,19 @@ IMAGE_REGISTRY?=registry.svc.ci.openshift.org
# It will generate target "image-$(1)" for building the image and binding it as a prerequisite to target "images".
$(call build-image,ocp-cluster-authentication-operator,$(IMAGE_REGISTRY)/ocp/4.3:cluster-authentication-operator,./Dockerfile.rhel7,.)

# This will call a macro called "run-local" which will use [telepresence](https://telepresence.io) to temporarily
# replace a deployed operator with a local process. Check the run-local-operator.sh script for more details as to
# how to customize this behavior (including the use of RL_DEBUG=y to run delve).
# $0 - macro name
# $1 - relative path to the yaml file defining the deployment to target
# $2 - relative path of the go module that will be executed with `go run`
# $3 - the name of the configmap used for leader election locking
# $4 - the 1st argument to the command
# $5 - the rest of the arguments to the command
# $6 - build flags used to compile the command (may be necessary for operators that customize compilation between ocp and okd)
# It will generate target "run-local" for running the operator via telepresence.
$(call add-run-local,manifests/07_deployment.yaml,cmd/authentication-operator,cluster-authentication-operator-lock,operator,--config=/var/run/configmaps/config/operator-config.yaml --v=2 --terminate-on-files=/var/run/configmaps/trusted-ca-bundle/ca-bundle.crt,-tags ocp)

# generate bindata targets
$(call add-bindata,assets,./bindata/...,bindata,assets,pkg/operator2/assets/bindata.go)

Expand Down

0 comments on commit 1a9a0ae

Please sign in to comment.