feat(workers): Add storage path parameter to worker config

This commit is contained in:
Haotian authored and GitHub committed 2022-05-11 17:15:38 -07:00
1 parent 8ebb8d1477
commit 898da56a77
2 files changed
+5 -1

No files matched your search

+3
View File
@@ -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) {
+2 -1
View File
@@ -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
}