Skip to content

Commit 2701c61

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 <[email protected]>
1 parent 268db50 commit 2701c61

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
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

Lines changed: 0 additions & 9 deletions
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"
@@ -409,14 +408,6 @@ func mustInitStorage(path string, storageAdvAddr string, artifactRetentionTTL ti
409408
intdigest.Canonical = algo
410409
}
411410

412-
if path == "" {
413-
p, _ := os.Getwd()
414-
// TODO(hidde): look at this default path, seems to be an artifact of
415-
// old things.
416-
path = filepath.Join(p, "bin")
417-
os.MkdirAll(path, 0o700)
418-
}
419-
420411
storage, err := controllers.NewStorage(path, storageAdvAddr, artifactRetentionTTL, artifactRetentionRecords)
421412
if err != nil {
422413
setupLog.Error(err, "unable to initialise storage")

0 commit comments

Comments
 (0)