Skip to content

Commit efb53df

Browse files
committed
fix: use prenodeadm commands name
1 parent f4eee44 commit efb53df

File tree

8 files changed

+44
-44
lines changed

8 files changed

+44
-44
lines changed

bootstrap/eks/api/v1beta2/nodeadmconfig_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ type NodeadmConfigSpec struct {
2121
// +optional
2222
FeatureGates map[Feature]bool `json:"featureGates,omitempty"`
2323

24-
// PreBootstrapCommands specifies extra commands to run before bootstrapping nodes.
24+
// PreNodeadmCommands specifies extra commands to run before bootstrapping nodes.
2525
// +optional
26-
PreBootstrapCommands []string `json:"preBootstrapCommands,omitempty"`
26+
PreNodeadmCommands []string `json:"PreNodeadmCommands,omitempty"`
2727

2828
// Files specifies extra files to be passed to user_data upon creation.
2929
// +optional

bootstrap/eks/api/v1beta2/zz_generated.deepcopy.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/eks/controllers/nodeadmconfig_controller.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,15 @@ func (r *NodeadmConfigReconciler) joinWorker(ctx context.Context, cluster *clust
201201
}
202202
nodeInput := &userdata.NodeadmInput{
203203
// AWSManagedControlPlane webhooks default and validate EKSClusterName
204-
ClusterName: controlPlane.Spec.EKSClusterName,
205-
PreBootstrapCommands: config.Spec.PreBootstrapCommands,
206-
Users: config.Spec.Users,
207-
NTP: config.Spec.NTP,
208-
DiskSetup: config.Spec.DiskSetup,
209-
Mounts: config.Spec.Mounts,
210-
Files: files,
211-
ServiceCIDR: serviceCIDR,
212-
APIServerEndpoint: controlPlane.Spec.ControlPlaneEndpoint.Host,
204+
ClusterName: controlPlane.Spec.EKSClusterName,
205+
PreNodeadmCommands: config.Spec.PreNodeadmCommands,
206+
Users: config.Spec.Users,
207+
NTP: config.Spec.NTP,
208+
DiskSetup: config.Spec.DiskSetup,
209+
Mounts: config.Spec.Mounts,
210+
Files: files,
211+
ServiceCIDR: serviceCIDR,
212+
APIServerEndpoint: controlPlane.Spec.ControlPlaneEndpoint.Host,
213213
}
214214
if config.Spec.Kubelet != nil {
215215
nodeInput.KubeletFlags = config.Spec.Kubelet.Flags

bootstrap/eks/internal/userdata/nodeadm.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Content-Disposition: attachment; filename="commands.sh"
6868
set -o errexit
6969
set -o pipefail
7070
set -o nounset
71-
{{- range .PreBootstrapCommands}}
71+
{{- range .PreNodeadmCommands}}
7272
{{.}}
7373
{{- end}}
7474
--{{ .Boundary }}`
@@ -144,12 +144,12 @@ type NodeadmInput struct {
144144
ContainerdBaseRuntimeSpec *runtime.RawExtension
145145
FeatureGates map[eksbootstrapv1.Feature]bool
146146

147-
PreBootstrapCommands []string
148-
Files []eksbootstrapv1.File
149-
DiskSetup *eksbootstrapv1.DiskSetup
150-
Mounts []eksbootstrapv1.MountPoints
151-
Users []eksbootstrapv1.User
152-
NTP *eksbootstrapv1.NTP
147+
PreNodeadmCommands []string
148+
Files []eksbootstrapv1.File
149+
DiskSetup *eksbootstrapv1.DiskSetup
150+
Mounts []eksbootstrapv1.MountPoints
151+
Users []eksbootstrapv1.User
152+
NTP *eksbootstrapv1.NTP
153153

154154
AMIImageID string
155155
APIServerEndpoint string
@@ -193,7 +193,7 @@ func NewNodeadmUserdata(input *NodeadmInput) ([]byte, error) {
193193
}
194194

195195
// Write shell script part if needed
196-
if len(input.PreBootstrapCommands) > 0 {
196+
if len(input.PreNodeadmCommands) > 0 {
197197
shellScriptTemplate := template.Must(template.New("shell").Parse(shellScriptPartTemplate))
198198
if err := shellScriptTemplate.Execute(&buf, input); err != nil {
199199
return nil, fmt.Errorf("failed to execute shell script template: %v", err)

bootstrap/eks/internal/userdata/nodeadm_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ evictionHard:
110110
ClusterName: "test-cluster",
111111
APIServerEndpoint: "https://example.com",
112112
CACert: "test-ca-cert",
113-
PreBootstrapCommands: []string{
113+
PreNodeadmCommands: []string{
114114
"echo 'pre-bootstrap'",
115115
"yum install -y htop",
116116
},
@@ -238,11 +238,11 @@ evictionHard:
238238
name: "boundary verification - all three parts with custom boundary",
239239
args: args{
240240
input: &NodeadmInput{
241-
ClusterName: "test-cluster",
242-
APIServerEndpoint: "https://example.com",
243-
CACert: "test-ca-cert",
244-
Boundary: "CUSTOMBOUNDARY123",
245-
PreBootstrapCommands: []string{"echo 'pre-bootstrap'"},
241+
ClusterName: "test-cluster",
242+
APIServerEndpoint: "https://example.com",
243+
CACert: "test-ca-cert",
244+
Boundary: "CUSTOMBOUNDARY123",
245+
PreNodeadmCommands: []string{"echo 'pre-bootstrap'"},
246246
NTP: &eksbootstrapv1.NTP{
247247
Enabled: ptr.To(true),
248248
Servers: []string{"time.google.com"},
@@ -285,10 +285,10 @@ evictionHard:
285285
name: "boundary verification - all 3 parts",
286286
args: args{
287287
input: &NodeadmInput{
288-
ClusterName: "test-cluster",
289-
APIServerEndpoint: "https://example.com",
290-
CACert: "test-ca-cert",
291-
PreBootstrapCommands: []string{"echo 'test'"},
288+
ClusterName: "test-cluster",
289+
APIServerEndpoint: "https://example.com",
290+
CACert: "test-ca-cert",
291+
PreNodeadmCommands: []string{"echo 'test'"},
292292
NTP: &eksbootstrapv1.NTP{
293293
Enabled: ptr.To(true),
294294
Servers: []string{"time.google.com"},

config/crd/bases/bootstrap.cluster.x-k8s.io_nodeadmconfigs.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ spec:
3939
spec:
4040
description: NodeadmConfigSpec defines the desired state of NodeadmConfig.
4141
properties:
42+
PreNodeadmCommands:
43+
description: PreNodeadmCommands specifies extra commands to run before
44+
bootstrapping nodes.
45+
items:
46+
type: string
47+
type: array
4248
containerd:
4349
description: Containerd contains options for containerd.
4450
properties:
@@ -227,12 +233,6 @@ spec:
227233
type: string
228234
type: array
229235
type: object
230-
preBootstrapCommands:
231-
description: PreBootstrapCommands specifies extra commands to run
232-
before bootstrapping nodes.
233-
items:
234-
type: string
235-
type: array
236236
users:
237237
description: Users specifies extra users to add.
238238
items:

config/crd/bases/bootstrap.cluster.x-k8s.io_nodeadmconfigtemplates.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ spec:
5151
spec:
5252
description: NodeadmConfigSpec defines the desired state of NodeadmConfig.
5353
properties:
54+
PreNodeadmCommands:
55+
description: PreNodeadmCommands specifies extra commands to
56+
run before bootstrapping nodes.
57+
items:
58+
type: string
59+
type: array
5460
containerd:
5561
description: Containerd contains options for containerd.
5662
properties:
@@ -246,12 +252,6 @@ spec:
246252
type: string
247253
type: array
248254
type: object
249-
preBootstrapCommands:
250-
description: PreBootstrapCommands specifies extra commands
251-
to run before bootstrapping nodes.
252-
items:
253-
type: string
254-
type: array
255255
users:
256256
description: Users specifies extra users to add.
257257
items:

test/e2e/suites/managed/eks_upgrade_to_nodeadm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var _ = ginkgo.Describe("EKS Cluster upgrade test", func() {
135135
Spec: eksbootstrapv1.NodeadmConfigTemplateSpec{
136136
Template: eksbootstrapv1.NodeadmConfigTemplateResource{
137137
Spec: eksbootstrapv1.NodeadmConfigSpec{
138-
PreBootstrapCommands: []string{
138+
PreNodeadmCommands: []string{
139139
"echo \"hello world\"",
140140
},
141141
},

0 commit comments

Comments
 (0)