Skip to content

Commit 52d7bab

Browse files
committed
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>
1 parent ff46bb9 commit 52d7bab

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ test-api: ## Run api tests
9494
cd api; go test $(GO_TEST_ARGS) ./... -coverprofile cover.out
9595

9696
run: generate fmt vet manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
97-
go run $(GO_STATIC_FLAGS) ./main.go
97+
@mkdir -p $(PWD)/bin/data
98+
go run $(GO_STATIC_FLAGS) ./main.go --storage-adv-addr=:0 --storage-path=$(PWD)/bin/data
9899

99100
install: manifests ## Install CRDs into a cluster
100101
kustomize build config/crd | kubectl apply -f -

main.go

-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"net"
2222
"net/http"
2323
"os"
24-
"path/filepath"
2524
"time"
2625

2726
flag "github.com/spf13/pflag"
@@ -403,14 +402,6 @@ func mustInitStorage(path string, storageAdvAddr string, artifactRetentionTTL ti
403402
intdigest.Canonical = algo
404403
}
405404

406-
if path == "" {
407-
p, _ := os.Getwd()
408-
// TODO(hidde): look at this default path, seems to be an artifact of
409-
// old things.
410-
path = filepath.Join(p, "bin")
411-
os.MkdirAll(path, 0o700)
412-
}
413-
414405
storage, err := controllers.NewStorage(path, storageAdvAddr, artifactRetentionTTL, artifactRetentionRecords)
415406
if err != nil {
416407
setupLog.Error(err, "unable to initialise storage")

0 commit comments

Comments
 (0)