Skip to content

Commit bf20f9b

Browse files
authored
Merge branch 'main' into dependabot/go_modules/github.com/tinkerbell/tink-0.12.2
2 parents beee2a3 + da7daea commit bf20f9b

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Build the manager binary
1616
ARG GOVER=1.23
17-
FROM golang:${GOVER} as builder
17+
FROM golang:${GOVER} AS builder
1818

1919
WORKDIR /workspace
2020

api/v1beta1/tinkerbellmachine_types.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,17 @@ type TinkerbellMachineSpec struct {
8585
// BootOptions are options that control the booting of Hardware.
8686
type BootOptions struct {
8787
// ISOURL is the URL of the ISO that will be one-time booted.
88-
// When this field is set, the controller will create a job.bmc.tinkerbell.org object
89-
// for getting the associated hardware into a CDROM booting state.
9088
// A HardwareRef that contains a spec.BmcRef must be provided.
9189
//
92-
// The format of the ISOURL must be http://$IP:$Port/iso/:macAddress/hook.iso
90+
// The format of the ISOURL must be http://$IP:$Port/iso/hook.iso
9391
// The name of the ISO file must have the .iso extension, but the name can be anything.
9492
// The $IP and $Port should generally point to the IP and Port of the Smee server
9593
// as this is where the ISO patching endpoint lives.
96-
// The ":macAddress" is a placeholder for the MAC address of the hardware and
97-
// should be provided exactly as is: ":macAddress".
94+
// The controller will append the MAC address of the hardware in the ISO URL
95+
// right before the iso file name in the URL.
96+
// MAC address is then used to retrieve hardware specific information such as
97+
// IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
98+
// For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
9899
// +optional
99100
// +kubebuilder:validation:Format=url
100101
ISOURL string `json:"isoURL,omitempty"`

config/crd/bases/infrastructure.cluster.x-k8s.io_tinkerbellmachines.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,17 @@ spec:
7777
isoURL:
7878
description: |-
7979
ISOURL is the URL of the ISO that will be one-time booted.
80-
When this field is set, the controller will create a job.bmc.tinkerbell.org object
81-
for getting the associated hardware into a CDROM booting state.
8280
A HardwareRef that contains a spec.BmcRef must be provided.
8381
84-
The format of the ISOURL must be http://$IP:$Port/iso/:macAddress/hook.iso
82+
The format of the ISOURL must be http://$IP:$Port/iso/hook.iso
8583
The name of the ISO file must have the .iso extension, but the name can be anything.
8684
The $IP and $Port should generally point to the IP and Port of the Smee server
8785
as this is where the ISO patching endpoint lives.
88-
The ":macAddress" is a placeholder for the MAC address of the hardware and
89-
should be provided exactly as is: ":macAddress".
86+
The controller will append the MAC address of the hardware in the ISO URL
87+
right before the iso file name in the URL.
88+
MAC address is then used to retrieve hardware specific information such as
89+
IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
90+
For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
9091
format: url
9192
type: string
9293
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_tinkerbellmachinetemplates.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ spec:
6767
isoURL:
6868
description: |-
6969
ISOURL is the URL of the ISO that will be one-time booted.
70-
When this field is set, the controller will create a job.bmc.tinkerbell.org object
71-
for getting the associated hardware into a CDROM booting state.
7270
A HardwareRef that contains a spec.BmcRef must be provided.
7371
74-
The format of the ISOURL must be http://$IP:$Port/iso/:macAddress/hook.iso
72+
The format of the ISOURL must be http://$IP:$Port/iso/hook.iso
7573
The name of the ISO file must have the .iso extension, but the name can be anything.
7674
The $IP and $Port should generally point to the IP and Port of the Smee server
7775
as this is where the ISO patching endpoint lives.
78-
The ":macAddress" is a placeholder for the MAC address of the hardware and
79-
should be provided exactly as is: ":macAddress".
76+
The controller will append the MAC address of the hardware in the ISO URL
77+
right before the iso file name in the URL.
78+
MAC address is then used to retrieve hardware specific information such as
79+
IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
80+
For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
8081
format: url
8182
type: string
8283
type: object

controller/machine/workflow.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"net/url"
7+
"path"
78
"strings"
89

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

85-
u.Path = strings.Replace(u.Path, ":macAddress", strings.Replace(hw.Spec.Metadata.Instance.ID, ":", "-", 5), 1)
86+
urlPath, file := path.Split(u.Path)
87+
u.Path = path.Join(urlPath, strings.Replace(hw.Spec.Metadata.Instance.ID, ":", "-", 5), file)
88+
8689
workflow.Spec.BootOptions.ISOURL = u.String()
8790
workflow.Spec.BootOptions.BootMode = tinkv1.BootMode("iso")
8891
}

0 commit comments

Comments
 (0)