diff --git a/cmd/controller/controller.go b/cmd/controller/controller.go index 96d8d5863053..ade3efee648c 100644 --- a/cmd/controller/controller.go +++ b/cmd/controller/controller.go @@ -44,6 +44,7 @@ import ( "github.com/k0sproject/k0s/pkg/certificate" "github.com/k0sproject/k0s/pkg/component/controller" "github.com/k0sproject/k0s/pkg/component/controller/clusterconfig" + "github.com/k0sproject/k0s/pkg/component/controller/cplb" "github.com/k0sproject/k0s/pkg/component/controller/leaderelector" "github.com/k0sproject/k0s/pkg/component/controller/workerconfig" "github.com/k0sproject/k0s/pkg/component/manager" @@ -237,14 +238,14 @@ func (c *command) start(ctx context.Context) error { // Assume a single active controller during startup numActiveControllers := value.NewLatest[uint](1) - if cplb := nodeConfig.Spec.Network.ControlPlaneLoadBalancing; cplb != nil && cplb.Enabled { + if cplbCfg := nodeConfig.Spec.Network.ControlPlaneLoadBalancing; cplbCfg != nil && cplbCfg.Enabled { if c.SingleNode { return errors.New("control plane load balancing cannot be used in a single-node cluster") } - nodeComponents.Add(ctx, &controller.Keepalived{ + nodeComponents.Add(ctx, &cplb.Keepalived{ K0sVars: c.K0sVars, - Config: cplb.Keepalived, + Config: cplbCfg.Keepalived, DetailedLogging: c.Debug, LogConfig: c.Debug, KubeConfigPath: c.K0sVars.AdminKubeConfigPath, diff --git a/pkg/component/controller/cplb_linux.go b/pkg/component/controller/cplb/cplb_linux.go similarity index 99% rename from pkg/component/controller/cplb_linux.go rename to pkg/component/controller/cplb/cplb_linux.go index 9f7f1f28a1ad..1803435be105 100644 --- a/pkg/component/controller/cplb_linux.go +++ b/pkg/component/controller/cplb/cplb_linux.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controller +package cplb import ( "bufio" diff --git a/pkg/component/controller/cplb_other.go b/pkg/component/controller/cplb/cplb_other.go similarity index 98% rename from pkg/component/controller/cplb_other.go rename to pkg/component/controller/cplb/cplb_other.go index 48698989424f..2f28ec430930 100644 --- a/pkg/component/controller/cplb_other.go +++ b/pkg/component/controller/cplb/cplb_other.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controller +package cplb import ( "context" diff --git a/pkg/component/controller/cplb_reconciler.go b/pkg/component/controller/cplb/cplb_reconciler.go similarity index 99% rename from pkg/component/controller/cplb_reconciler.go rename to pkg/component/controller/cplb/cplb_reconciler.go index ff9e2aa15dac..659c70307ba8 100644 --- a/pkg/component/controller/cplb_reconciler.go +++ b/pkg/component/controller/cplb/cplb_reconciler.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controller +package cplb import ( "context" diff --git a/pkg/component/controller/cplb_reconciler_test.go b/pkg/component/controller/cplb/cplb_reconciler_test.go similarity index 99% rename from pkg/component/controller/cplb_reconciler_test.go rename to pkg/component/controller/cplb/cplb_reconciler_test.go index 029661346834..085f548d58c3 100644 --- a/pkg/component/controller/cplb_reconciler_test.go +++ b/pkg/component/controller/cplb/cplb_reconciler_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controller +package cplb import ( "testing"