Skip to content

Commit

Permalink
Drop elemental calls (#478)
Browse files Browse the repository at this point in the history
No longer used, move to kairos-agent

Also drop sha iso calculation as its done by the iso builder
automatically

Fixes kairos-io/kairos#1798

Signed-off-by: Itxaka <itxaka@kairos.io>
  • Loading branch information
Itxaka authored Sep 8, 2023
1 parent 7af168c commit 3b1a697
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ iso:
COPY +kairos/kairos/overlay/files-iso/ ./$overlay/
COPY +docker-rootfs/rootfs /build/image
RUN /entrypoint.sh --name $ISO_NAME --debug build-iso --date=false dir:/build/image --overlay-iso /build/${overlay} --output /build
# See: https://github.com/rancher/elemental-cli/issues/228
RUN sha256sum $ISO_NAME.iso > $ISO_NAME.iso.sha256
SAVE ARTIFACT /build/$ISO_NAME.iso kairos.iso AS LOCAL build/$ISO_NAME.iso
SAVE ARTIFACT /build/$ISO_NAME.iso.sha256 kairos.iso.sha256 AS LOCAL build/$ISO_NAME.iso.sha256

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
return pluggable.EventResponse{State: fmt.Sprintf("no kairos or k3s configuration. nothing to do: %s", cfg.Config)}
}

utils.SH("elemental run-stage kairos-agent.bootstrap") //nolint:errcheck
utils.SH("kairos-agent run-stage kairos-agent.bootstrap") //nolint:errcheck
bus.RunHookScript("/usr/bin/kairos-agent.bootstrap.hook") //nolint:errcheck

logLevel := "debug"
Expand Down
4 changes: 2 additions & 2 deletions internal/role/p2p/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func Master(cc *config.Config, pconfig *providerConfig.Config, clusterInit, ha b
// Configure k3s service to start on edgevpn0
c.Logger.Info("Configuring k3s")

utils.SH(fmt.Sprintf("elemental run-stage provider-kairos.bootstrap.before.%s", roleName)) //nolint:errcheck
utils.SH(fmt.Sprintf("kairos-agent run-stage provider-kairos.bootstrap.before.%s", roleName)) //nolint:errcheck

svc, err := machine.K3s()
if err != nil {
Expand Down Expand Up @@ -222,7 +222,7 @@ func Master(cc *config.Config, pconfig *providerConfig.Config, clusterInit, ha b
return err
}

utils.SH(fmt.Sprintf("elemental run-stage provider-kairos.bootstrap.after.%s", roleName)) //nolint:errcheck
utils.SH(fmt.Sprintf("kairos-agent run-stage provider-kairos.bootstrap.after.%s", roleName)) //nolint:errcheck

return role.CreateSentinel()
}
Expand Down
4 changes: 2 additions & 2 deletions internal/role/p2p/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func Worker(cc *config.Config, pconfig *providerConfig.Config) role.Role { //nol

c.Logger.Info("Configuring k3s-agent", masterIP, nodeToken, args)

utils.SH(fmt.Sprintf("elemental run-stage provider-kairos.bootstrap.before.%s", "worker")) //nolint:errcheck
utils.SH(fmt.Sprintf("kairos-agent run-stage provider-kairos.bootstrap.before.%s", "worker")) //nolint:errcheck

// Setup systemd unit and starts it
if err := utils.WriteEnv(machine.K3sEnvUnit("k3s-agent"),
Expand Down Expand Up @@ -120,7 +120,7 @@ func Worker(cc *config.Config, pconfig *providerConfig.Config) role.Role { //nol
return err
}

utils.SH(fmt.Sprintf("elemental run-stage provider-kairos.bootstrap.after.%s", "worker")) //nolint:errcheck
utils.SH(fmt.Sprintf("kairos-agent run-stage provider-kairos.bootstrap.after.%s", "worker")) //nolint:errcheck

return role.CreateSentinel()
}
Expand Down

0 comments on commit 3b1a697

Please sign in to comment.