Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/tinkerbell/…
Browse files Browse the repository at this point in the history
…tink-0.12.2
  • Loading branch information
mergify[bot] authored Jan 16, 2025
2 parents beee2a3 + da7daea commit bf20f9b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Build the manager binary
ARG GOVER=1.23
FROM golang:${GOVER} as builder
FROM golang:${GOVER} AS builder

WORKDIR /workspace

Expand Down
11 changes: 6 additions & 5 deletions api/v1beta1/tinkerbellmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,17 @@ type TinkerbellMachineSpec struct {
// BootOptions are options that control the booting of Hardware.
type BootOptions struct {
// ISOURL is the URL of the ISO that will be one-time booted.
// When this field is set, the controller will create a job.bmc.tinkerbell.org object
// for getting the associated hardware into a CDROM booting state.
// A HardwareRef that contains a spec.BmcRef must be provided.
//
// The format of the ISOURL must be http://$IP:$Port/iso/:macAddress/hook.iso
// The format of the ISOURL must be http://$IP:$Port/iso/hook.iso
// The name of the ISO file must have the .iso extension, but the name can be anything.
// The $IP and $Port should generally point to the IP and Port of the Smee server
// as this is where the ISO patching endpoint lives.
// The ":macAddress" is a placeholder for the MAC address of the hardware and
// should be provided exactly as is: ":macAddress".
// The controller will append the MAC address of the hardware in the ISO URL
// right before the iso file name in the URL.
// MAC address is then used to retrieve hardware specific information such as
// IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
// For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
// +optional
// +kubebuilder:validation:Format=url
ISOURL string `json:"isoURL,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,17 @@ spec:
isoURL:
description: |-
ISOURL is the URL of the ISO that will be one-time booted.
When this field is set, the controller will create a job.bmc.tinkerbell.org object
for getting the associated hardware into a CDROM booting state.
A HardwareRef that contains a spec.BmcRef must be provided.
The format of the ISOURL must be http://$IP:$Port/iso/:macAddress/hook.iso
The format of the ISOURL must be http://$IP:$Port/iso/hook.iso
The name of the ISO file must have the .iso extension, but the name can be anything.
The $IP and $Port should generally point to the IP and Port of the Smee server
as this is where the ISO patching endpoint lives.
The ":macAddress" is a placeholder for the MAC address of the hardware and
should be provided exactly as is: ":macAddress".
The controller will append the MAC address of the hardware in the ISO URL
right before the iso file name in the URL.
MAC address is then used to retrieve hardware specific information such as
IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
format: url
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ spec:
isoURL:
description: |-
ISOURL is the URL of the ISO that will be one-time booted.
When this field is set, the controller will create a job.bmc.tinkerbell.org object
for getting the associated hardware into a CDROM booting state.
A HardwareRef that contains a spec.BmcRef must be provided.
The format of the ISOURL must be http://$IP:$Port/iso/:macAddress/hook.iso
The format of the ISOURL must be http://$IP:$Port/iso/hook.iso
The name of the ISO file must have the .iso extension, but the name can be anything.
The $IP and $Port should generally point to the IP and Port of the Smee server
as this is where the ISO patching endpoint lives.
The ":macAddress" is a placeholder for the MAC address of the hardware and
should be provided exactly as is: ":macAddress".
The controller will append the MAC address of the hardware in the ISO URL
right before the iso file name in the URL.
MAC address is then used to retrieve hardware specific information such as
IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
format: url
type: string
type: object
Expand Down
5 changes: 4 additions & 1 deletion controller/machine/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"net/url"
"path"
"strings"

"github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
Expand Down Expand Up @@ -82,7 +83,9 @@ func (scope *machineReconcileScope) createWorkflow(hw *tinkv1.Hardware) error {
return fmt.Errorf("boot option isoURL is not parse-able: %w", err)
}

u.Path = strings.Replace(u.Path, ":macAddress", strings.Replace(hw.Spec.Metadata.Instance.ID, ":", "-", 5), 1)
urlPath, file := path.Split(u.Path)
u.Path = path.Join(urlPath, strings.Replace(hw.Spec.Metadata.Instance.ID, ":", "-", 5), file)

workflow.Spec.BootOptions.ISOURL = u.String()
workflow.Spec.BootOptions.BootMode = tinkv1.BootMode("iso")
}
Expand Down

0 comments on commit bf20f9b

Please sign in to comment.