commit before using cursor

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
Mauro Morales
2025-03-26 10:04:10 +01:00
parent bdd7909d05
commit 65e49b898b
7 changed files with 43 additions and 25 deletions

View File

@@ -49,8 +49,8 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
tokenNotDefined := (p2pBlockDefined && prvConfig.P2P.NetworkToken == "") || !p2pBlockDefined
skipAuto := p2pBlockDefined && !prvConfig.P2P.Auto.IsEnabled()
worker, _ := p2p.NewK8sWorker(prvConfig)
if prvConfig.P2P == nil && worker == nil {
sd, _ := p2p.NewServiceDefinition(prvConfig)
if prvConfig.P2P == nil && sd == nil {
return pluggable.EventResponse{State: fmt.Sprintf("no kubernetes distribution configuration. nothing to do: %s", cfg.Config)}
}
@@ -68,7 +68,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
// Do onetimebootstrap if a Kubernetes distribution is enabled.
// Those blocks are not required to be enabled in case of a kairos
// full automated setup. Otherwise, they must be explicitly enabled.
if (tokenNotDefined && worker != nil) || skipAuto {
if (tokenNotDefined && sd != nil) || skipAuto {
err := oneTimeBootstrap(logger, prvConfig, func() error {
return SetupVPN(services.EdgeVPNDefaultInstance, cfg.APIAddress, "/", true, prvConfig)
})
@@ -134,6 +134,18 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
Role: common.RoleAuto,
RoleHandler: role.Auto(c, prvConfig),
},
service.RoleKey{
Role: common.RoleControlPlane,
RoleHandler: p2p.ControlPlane(c, prvConfig, common.RoleControlPlane),
},
service.RoleKey{
Role: common.RoleMasterInit,
RoleHandler: p2p.ControlPlane(c, prvConfig, common.RoleControlPlaneClusterInit),
},
service.RoleKey{
Role: common.RoleMasterHA,
RoleHandler: p2p.ControlPlane(c, prvConfig, common.RoleControlPlaneHA),
},
),
}