File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ IMG ?= controller:latest
2323CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
2424# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
2525ENVTEST_K8S_VERSION = 1.21
26+ # Operator YAML file
27+ OPERATOR_YAML =$$(basename $$(pwd ) ) .yaml
2628
2729# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
2830ifeq (,$(shell go env GOBIN) )
@@ -90,9 +92,14 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
9092 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
9193 $(KUSTOMIZE ) build config/default | kubectl apply -f -
9294
95+ # Bug:34265574
96+ # Used sed to reposition the controller-manager Deployment after the certificate creation in the OPERATOR_YAML
9397operator-yaml : manifests kustomize
9498 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
95- $(KUSTOMIZE ) build config/default > $$(basename $$(pwd ) ) .yaml
99+ $(KUSTOMIZE ) build config/default > " ${OPERATOR_YAML} "
100+ sed -i.bak -e ' /^apiVersion: apps\/v1/,/---/d' " ${OPERATOR_YAML} "
101+ (echo --- && sed ' /^apiVersion: apps\/v1/,/---/!d' " ${OPERATOR_YAML} .bak" ) >> " ${OPERATOR_YAML} "
102+ rm " ${OPERATOR_YAML} .bak"
96103
97104undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config.
98105 $(KUSTOMIZE ) build config/default | kubectl delete -f -
You can’t perform that action at this time.
0 commit comments