Skip to content

Commit

Permalink
Merge pull request #4098 from k0sproject/backport-4096-to-release-1.28
Browse files Browse the repository at this point in the history
[Backport release-1.28] Error out when NLLB is enabled for a single-node cluster
  • Loading branch information
twz123 authored Feb 21, 2024
2 parents 0fd6c73 + 37ad6f5 commit d83e1fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package worker

import (
"context"
"errors"
"fmt"
"os"
"os/signal"
Expand Down Expand Up @@ -130,7 +131,11 @@ func (c *Command) Start(ctx context.Context) error {

var staticPods worker.StaticPods

if !c.SingleNode && workerConfig.NodeLocalLoadBalancing.IsEnabled() {
if workerConfig.NodeLocalLoadBalancing.IsEnabled() {
if c.SingleNode {
return errors.New("node-local load balancing cannot be used in a single-node cluster")
}

sp := worker.NewStaticPods()
reconciler, err := nllb.NewReconciler(c.K0sVars, sp, c.WorkerProfile, *workerConfig.DeepCopy())
if err != nil {
Expand Down

0 comments on commit d83e1fe

Please sign in to comment.