From 898da56a7765b5011808f013acf9ab4b957e85e9 Mon Sep 17 00:00:00 2001 From: Haotian Date: Wed, 11 May 2022 17:15:38 -0700 Subject: [PATCH] feat(workers): Add storage path parameter to worker config --- internal/cmd/config/config.go | 3 +++ internal/daemon/worker/worker.go | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cmd/config/config.go b/internal/cmd/config/config.go index 832782a4e..f79840f98 100644 --- a/internal/cmd/config/config.go +++ b/internal/cmd/config/config.go @@ -187,6 +187,9 @@ type Worker struct { // // TODO: This field is currently internal. StatusGracePeriodDuration time.Duration `hcl:"-"` + + // StoragePath represents the location a pki worker stores its node credentials, if set. + StoragePath string `hcl:"storage_path"` } func (w *Worker) InitNameIfEmpty() (string, error) { diff --git a/internal/daemon/worker/worker.go b/internal/daemon/worker/worker.go index 9cd3e7f6f..b4573220a 100644 --- a/internal/daemon/worker/worker.go +++ b/internal/daemon/worker/worker.go @@ -180,7 +180,8 @@ func (w *Worker) Start() error { } var err error - w.NodeeFileStorage, err = nodeefile.NewFileStorage(w.baseContext) + w.NodeeFileStorage, err = nodeefile.NewFileStorage(w.baseContext, + nodeefile.WithFileStorageBaseDirectory(w.conf.RawConfig.Worker.StoragePath)) if err != nil { return err }