Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/worker/storage: Disable storage worker when no runtimes configured #5394

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/5394.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/worker/storage: Disable storage worker when no runtimes configured
2 changes: 1 addition & 1 deletion go/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (m NodeMode) IsClientOnly() bool {
// HasLocalStorage returns true iff the mode is one that has local storage.
func (m NodeMode) HasLocalStorage() bool {
switch m {
case ModeClient, ModeCompute:
case ModeClient, ModeCompute, ModeArchive:
return true
}
return false
Expand Down
5 changes: 1 addition & 4 deletions go/worker/storage/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ func New(
commonWorker *workerCommon.Worker,
registration *registration.Worker,
) (*Worker, error) {
enabled := config.GlobalConfig.Mode.HasLocalStorage()
if config.GlobalConfig.Mode == config.ModeArchive && len(commonWorker.GetRuntimes()) > 0 {
enabled = true
}
enabled := config.GlobalConfig.Mode.HasLocalStorage() && len(commonWorker.GetRuntimes()) > 0

s := &Worker{
enabled: enabled,
Expand Down