@@ -40,6 +40,10 @@ IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
4040# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
4141CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
4242
43+ # Change DOCKERFILE tp openshift.Dockerfile to build Openshift image
44+ DOCKERFILE ?= Dockerfile
45+ RH_RBAC_IMAGE ?= registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.7
46+
4347# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
4448ifeq (,$(shell go env GOBIN) )
4549GOBIN =$(shell go env GOPATH) /bin
@@ -100,7 +104,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
100104 go run -ldflags " -X main.version=${VERSION} " ./main.go $(ARGS )
101105
102106docker-build : test # # Build docker image with the manager.
103- docker build -t ${IMG} . --build-arg VERSION=${VERSION}
107+ docker build -t ${IMG} -f ${DOCKERFILE} . --build-arg VERSION=${VERSION}
104108
105109docker-push : # # Push docker image with the manager.
106110 docker push ${IMG}
@@ -117,6 +121,12 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
117121 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
118122 $(KUSTOMIZE ) build config/default | kubectl apply -f -
119123
124+ openshift-deploy : manifests kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
125+ VAL=" ${RH_RBAC_IMAGE} " yq e ' .spec.template.spec.containers[0].image = strenv(VAL)' -i config/default/manager_auth_proxy_patch.yaml
126+ cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
127+
128+ # #$(KUSTOMIZE) build config/default | kubectl apply -f -
129+
120130undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config.
121131 $(KUSTOMIZE ) build config/default | kubectl delete -f -
122132
0 commit comments