Skip to content

Commit

Permalink
allow worker id to be empty when worker isn't enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Jan 6, 2025
1 parent 7a930ff commit e147d15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

# Allow worker id to be empty when worker is disabled
7 changes: 6 additions & 1 deletion cmd/renterd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@ func defaultConfig() config.Config {
}

func assertWorkerID(cfg *config.Config) error {
if cfg.Bus.RemoteAddr != "" && cfg.Worker.ID == "" {
if !cfg.Worker.Enabled {
// no worker
return nil
} else if cfg.Bus.RemoteAddr != "" && cfg.Worker.ID == "" {
// remote worker
return errors.New("a unique worker ID must be set in a cluster setup")
} else if cfg.Worker.ID == "" {
// local worker
cfg.Worker.ID = "worker"
}
return nil
Expand Down

0 comments on commit e147d15

Please sign in to comment.