From 15b319e33162b1bb9877d41aa59c22f7b15d3ba8 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 14 Oct 2020 20:08:09 -0700 Subject: [PATCH] prepare env --- Makefile | 7 +++++-- README.md | 23 +++++++++++++++++++++++ seaweedfs-operator.iml | 9 +++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 README.md create mode 100644 seaweedfs-operator.iml diff --git a/Makefile b/Makefile index bea67d7..1b1c494 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ endif BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) # Image URL to use all building/pushing image targets -IMG ?= controller:latest +IMG ?= seaweedfs/operator:latest # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:trivialVersions=true" @@ -26,8 +26,11 @@ endif all: manager # Run tests +ENVTEST_ASSETS_DIR=$(shell pwd)/testbin test: generate fmt vet manifests - go test ./... -coverprofile cover.out + mkdir -p ${ENVTEST_ASSETS_DIR} + test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/master/hack/setup-envtest.sh + source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out # Build manager binary manager: generate fmt vet diff --git a/README.md b/README.md new file mode 100644 index 0000000..d2e7ece --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# SeaweedFS Operator + +## Installation + +## Development + +Follow the instructions in https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/ + +``` +$ 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 + +``` + diff --git a/seaweedfs-operator.iml b/seaweedfs-operator.iml new file mode 100644 index 0000000..eacc75a --- /dev/null +++ b/seaweedfs-operator.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file