@@ -21,19 +21,19 @@ import (
2121 "fmt"
2222 "text/template"
2323
24- "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2"
25-
2624 "github.com/alessio/shellescape"
2725
2826 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"
2928)
3029
3130const (
3231 defaultBootstrapCommand = "/etc/eks/bootstrap.sh"
3332 boundary = "//"
3433
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.
3737 AMIFamilyAL2023 = "AmazonLinux2023"
3838
3939 nodeUserData = `#cloud-config
@@ -49,7 +49,7 @@ runcmd:
4949{{- template "mounts" .Mounts}}
5050`
5151
52- // Multipart MIME template for AL2023
52+ // Multipart MIME template for AL2023.
5353 al2023UserDataTemplate = `MIME-Version: 1.0
5454Content-Type: multipart/mixed; boundary="{{.Boundary}}"
5555
7575
7676--{{.Boundary}}--`
7777
78- // AL2023-specific templates
78+ // AL2023-specific templates.
7979 al2023KubeletExtraArgsTemplate = `{{- define "al2023KubeletExtraArgs" -}}
8080{{- if . -}}
8181{{- range $k, $v := . -}}
@@ -211,7 +211,7 @@ type NodeInput struct {
211211 CapacityType * v1beta2.ManagedMachinePoolCapacityType
212212}
213213
214- // PauseContainerInfo holds pause container information for templates
214+ // PauseContainerInfo holds pause container information for templates.
215215type PauseContainerInfo struct {
216216 AccountNumber * string
217217 Version * string
@@ -246,7 +246,7 @@ func NewNode(input *NodeInput) ([]byte, error) {
246246 return generateStandardUserData (input )
247247}
248248
249- // generateStandardUserData generates userdata for AL2 and other standard node types
249+ // generateStandardUserData generates userdata for AL2 and other standard node types.
250250func generateStandardUserData (input * NodeInput ) ([]byte , error ) {
251251 tm := template .New ("Node" ).Funcs (defaultTemplateFuncMap )
252252
@@ -299,7 +299,7 @@ func generateStandardUserData(input *NodeInput) ([]byte, error) {
299299 return out .Bytes (), nil
300300}
301301
302- // generateAL2023UserData generates userdata for Amazon Linux 2023 nodes
302+ // generateAL2023UserData generates userdata for Amazon Linux 2023 nodes.
303303func generateAL2023UserData (input * NodeInput ) ([]byte , error ) {
304304 // Validate required AL2023 fields
305305 if input .APIServerEndpoint == "" {
0 commit comments