prepare env

This commit is contained in:
Chris Lu 2020-10-14 20:08:09 -07:00
parent 45d81b6928
commit 15b319e331
3 changed files with 37 additions and 2 deletions

View File

@ -12,7 +12,7 @@ endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# Image URL to use all building/pushing image targets # 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) # Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true" CRD_OPTIONS ?= "crd:trivialVersions=true"
@ -26,8 +26,11 @@ endif
all: manager all: manager
# Run tests # Run tests
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: generate fmt vet manifests 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 # Build manager binary
manager: generate fmt vet manager: generate fmt vet

23
README.md Normal file
View File

@ -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
```

9
seaweedfs-operator.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>