Remove auto-configuration of storage path
This was an artifact of the desire to run `make run` without any custom configuration, rather than it being a feature of the controller. The setup of this has now been moved to the `Makefile` itself, including the required configuration of the `--storage-adv-addr`. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
parent
268db50890
commit
2701c61635
3
Makefile
3
Makefile
|
@ -94,7 +94,8 @@ test-api: ## Run api tests
|
||||||
cd api; go test $(GO_TEST_ARGS) ./... -coverprofile cover.out
|
cd api; go test $(GO_TEST_ARGS) ./... -coverprofile cover.out
|
||||||
|
|
||||||
run: generate fmt vet manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
|
run: generate fmt vet manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
|
||||||
go run $(GO_STATIC_FLAGS) ./main.go
|
@mkdir -p $(PWD)/bin/data
|
||||||
|
go run $(GO_STATIC_FLAGS) ./main.go --storage-adv-addr=:0 --storage-path=$(PWD)/bin/data
|
||||||
|
|
||||||
install: manifests ## Install CRDs into a cluster
|
install: manifests ## Install CRDs into a cluster
|
||||||
kustomize build config/crd | kubectl apply -f -
|
kustomize build config/crd | kubectl apply -f -
|
||||||
|
|
9
main.go
9
main.go
|
@ -21,7 +21,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
flag "github.com/spf13/pflag"
|
flag "github.com/spf13/pflag"
|
||||||
|
@ -409,14 +408,6 @@ func mustInitStorage(path string, storageAdvAddr string, artifactRetentionTTL ti
|
||||||
intdigest.Canonical = algo
|
intdigest.Canonical = algo
|
||||||
}
|
}
|
||||||
|
|
||||||
if path == "" {
|
|
||||||
p, _ := os.Getwd()
|
|
||||||
// TODO(hidde): look at this default path, seems to be an artifact of
|
|
||||||
// old things.
|
|
||||||
path = filepath.Join(p, "bin")
|
|
||||||
os.MkdirAll(path, 0o700)
|
|
||||||
}
|
|
||||||
|
|
||||||
storage, err := controllers.NewStorage(path, storageAdvAddr, artifactRetentionTTL, artifactRetentionRecords)
|
storage, err := controllers.NewStorage(path, storageAdvAddr, artifactRetentionTTL, artifactRetentionRecords)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
setupLog.Error(err, "unable to initialise storage")
|
setupLog.Error(err, "unable to initialise storage")
|
||||||
|
|
Loading…
Reference in New Issue