Skip to content

Commit d56c5e5

Browse files
rsmittytalos-bot
authored andcommitted
fix: ensure machine configs work in packet
This PR does a check if we're dealing with a PacketMachine. If so, we prepend the shebang necessary to make userdata work there. Signed-off-by: Spencer Smith <[email protected]>
1 parent 3371173 commit d56c5e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

controllers/talosconfig_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ func (r *TalosConfigReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, rerr
187187
return ctrl.Result{}, errors.New("unknown generate type specified")
188188
}
189189

190+
// Packet acts a fool if you don't prepend #!talos to the userdata
191+
// so we try to suss out if that's the type of machine getting created.
192+
if machine.Spec.InfrastructureRef.Kind == "PacketMachine" {
193+
retData.BoostrapData = "#!talos\n" + retData.BoostrapData
194+
}
195+
190196
err = r.writeBootstrapData(ctx, tcScope, []byte(retData.BoostrapData))
191197
if err != nil {
192198
return ctrl.Result{}, err

0 commit comments

Comments
 (0)