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