Updates from review of 2076 (#2135)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2022-06-03 17:32:33 -04:00
1 parent 631c174f47
commit f4642930b4
3 files changed
+4 -11

No files matched your search

+2 -2
View File
@@ -196,8 +196,8 @@ 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.
AuthStoragePath string `hcl:"storage_path"`
// AuthStoragePath represents the location a worker stores its node credentials, if set
AuthStoragePath string `hcl:"auth_storage_path"`
}
func (w *Worker) InitNameIfEmpty() (string, error) {
+2 -2
View File
@@ -423,7 +423,7 @@ func TestDevWorkerCredentialStorageDir(t *testing.T) {
tags {
type = ["dev", "local"]
}
storage_path = ".."
auth_storage_path = ".."
}
`,
storagePath: "..",
@@ -442,7 +442,7 @@ func TestDevWorkerCredentialStorageDir(t *testing.T) {
tags {
type = ["dev", "local"]
}
storage_path = "nonexistent_dir/here"
auth_storage_path = "nonexistent_dir/here"
}
`,
storagePath: "nonexistent_dir/here",
-7
View File
@@ -184,13 +184,6 @@ func (w *Worker) Start() error {
controllerResolver := manual.NewBuilderWithScheme(scheme)
w.controllerResolver.Store(controllerResolver)
var err error
w.NodeeFileStorage, err = nodeefile.NewFileStorage(w.baseContext,
nodeefile.WithBaseDirectory(w.conf.RawConfig.Worker.AuthStoragePath))
if err != nil {
return err
}
if err := w.startListeners(); err != nil {
return fmt.Errorf("error starting worker listeners: %w", err)
}