Skip to content

Commit b978314

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 dbc7284 commit b978314

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
"github.com/opencontainers/go-digest"
@@ -399,14 +398,6 @@ func mustInitStorage(path string, storageAdvAddr string, artifactRetentionTTL ti
399398
intdigest.Canonical = algo
400399
}
401400

402-
if path == "" {
403-
p, _ := os.Getwd()
404-
// TODO(hidde): look at this default path, seems to be an artifact of
405-
// old things.
406-
path = filepath.Join(p, "bin")
407-
os.MkdirAll(path, 0o700)
408-
}
409-
410401
storage, err := controllers.NewStorage(path, storageAdvAddr, artifactRetentionTTL, artifactRetentionRecords)
411402
if err != nil {
412403
setupLog.Error(err, "unable to initialise storage")

0 commit comments

Comments
 (0)