@@ -21,19 +21,19 @@ import (
21
21
"fmt"
22
22
"text/template"
23
23
24
- "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2"
25
-
26
24
"github.com/alessio/shellescape"
27
25
28
26
eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/v2/bootstrap/eks/api/v1beta2"
27
+ "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2"
29
28
)
30
29
31
30
const (
32
31
defaultBootstrapCommand = "/etc/eks/bootstrap.sh"
33
32
boundary = "//"
34
33
35
- // AMI Family Types
36
- AMIFamilyAL2 = "AmazonLinux2"
34
+ // AMIFamilyAL2 is the Amazon Linux 2 AMI family.
35
+ AMIFamilyAL2 = "AmazonLinux2"
36
+ // AMIFamilyAL2023 is the Amazon Linux 2023 AMI family.
37
37
AMIFamilyAL2023 = "AmazonLinux2023"
38
38
39
39
nodeUserData = `#cloud-config
@@ -49,7 +49,7 @@ runcmd:
49
49
{{- template "mounts" .Mounts}}
50
50
`
51
51
52
- // Multipart MIME template for AL2023
52
+ // Multipart MIME template for AL2023.
53
53
al2023UserDataTemplate = `MIME-Version: 1.0
54
54
Content-Type: multipart/mixed; boundary="{{.Boundary}}"
55
55
75
75
76
76
--{{.Boundary}}--`
77
77
78
- // AL2023-specific templates
78
+ // AL2023-specific templates.
79
79
al2023KubeletExtraArgsTemplate = `{{- define "al2023KubeletExtraArgs" -}}
80
80
{{- if . -}}
81
81
{{- range $k, $v := . -}}
@@ -211,7 +211,7 @@ type NodeInput struct {
211
211
CapacityType * v1beta2.ManagedMachinePoolCapacityType
212
212
}
213
213
214
- // PauseContainerInfo holds pause container information for templates
214
+ // PauseContainerInfo holds pause container information for templates.
215
215
type PauseContainerInfo struct {
216
216
AccountNumber * string
217
217
Version * string
@@ -246,7 +246,7 @@ func NewNode(input *NodeInput) ([]byte, error) {
246
246
return generateStandardUserData (input )
247
247
}
248
248
249
- // generateStandardUserData generates userdata for AL2 and other standard node types
249
+ // generateStandardUserData generates userdata for AL2 and other standard node types.
250
250
func generateStandardUserData (input * NodeInput ) ([]byte , error ) {
251
251
tm := template .New ("Node" ).Funcs (defaultTemplateFuncMap )
252
252
@@ -299,7 +299,7 @@ func generateStandardUserData(input *NodeInput) ([]byte, error) {
299
299
return out .Bytes (), nil
300
300
}
301
301
302
- // generateAL2023UserData generates userdata for Amazon Linux 2023 nodes
302
+ // generateAL2023UserData generates userdata for Amazon Linux 2023 nodes.
303
303
func generateAL2023UserData (input * NodeInput ) ([]byte , error ) {
304
304
// Validate required AL2023 fields
305
305
if input .APIServerEndpoint == "" {
0 commit comments