From 15fc33c506cdf7c7d5e618c837d2f472e1efcee3 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 9 Nov 2020 23:28:13 -0800 Subject: [PATCH] add back steps to develop outside of k8s --- README.md | 18 +++++++++++++++++- controllers/seaweed_controller.go | 6 ++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 018c2ee..72eeb6b 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ $ kubectl apply -f config/samples/seaweed_v1_seaweed.yaml ``` -Update the operator +### Update the operator ``` # delete the existing operator $ kubectl delete namespace seaweedfs-operator-system @@ -47,4 +47,20 @@ $ kind load docker-image seaweedfs/operator:v0.0.1 # register the CRD with the Kubernetes $ make deploy +``` + +### develop outside of k8s + +``` +$ git clone https://github.com/seaweedfs/seaweedfs-operator +$ cd seaweedfs-operator + +# register the CRD with the Kubernetes +$ make install + +# run the operator locally outside the Kubernetes cluster +$ make run ENABLE_WEBHOOKS=false + +# From another terminal in the same directory +$ kubectl apply -f config/samples/seaweed_v1_seaweed.yaml ``` \ No newline at end of file diff --git a/controllers/seaweed_controller.go b/controllers/seaweed_controller.go index a3891c8..f94d471 100644 --- a/controllers/seaweed_controller.go +++ b/controllers/seaweed_controller.go @@ -72,8 +72,10 @@ func (r *SeaweedReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { return result, err } - if done, result, err = r.maintenance(seaweedCR); done { - return result, err + if false { + if done, result, err = r.maintenance(seaweedCR); done { + return result, err + } } return ctrl.Result{RequeueAfter: 5 * time.Second}, nil