Skip to content

Commit af2a59e

Browse files
committed
capitalize DNS abbreviation
1 parent 2eed587 commit af2a59e

24 files changed

+113
-101
lines changed

api/v1beta1/awscluster_conversion.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error {
4848
if restored.Status.Bastion != nil {
4949
dst.Status.Bastion.InstanceMetadataOptions = restored.Status.Bastion.InstanceMetadataOptions
5050
dst.Status.Bastion.PlacementGroupName = restored.Status.Bastion.PlacementGroupName
51+
dst.Status.Bastion.PrivateDNSNameOptions = restored.Status.Bastion.PrivateDNSNameOptions
5152
}
5253
dst.Spec.Partition = restored.Spec.Partition
5354

@@ -91,6 +92,7 @@ func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error {
9192
}
9293

9394
dst.Spec.NetworkSpec.VPC.EmptyRoutesDefaultVPCSecurityGroup = restored.Spec.NetworkSpec.VPC.EmptyRoutesDefaultVPCSecurityGroup
95+
dst.Spec.NetworkSpec.VPC.PrivateDNSHostnameTypeOnLaunch = restored.Spec.NetworkSpec.VPC.PrivateDNSHostnameTypeOnLaunch
9496

9597
// Restore SubnetSpec.ResourceID field, if any.
9698
for _, subnet := range restored.Spec.NetworkSpec.Subnets {

api/v1beta1/awsmachine_conversion.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func (src *AWSMachine) ConvertTo(dstRaw conversion.Hub) error {
3838
dst.Spec.Ignition = restored.Spec.Ignition
3939
dst.Spec.InstanceMetadataOptions = restored.Spec.InstanceMetadataOptions
4040
dst.Spec.PlacementGroupName = restored.Spec.PlacementGroupName
41+
dst.Spec.PrivateDNSNameOptions = restored.Spec.PrivateDNSNameOptions
4142

4243
return nil
4344
}
@@ -85,6 +86,7 @@ func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
8586
dst.Spec.Template.Spec.Ignition = restored.Spec.Template.Spec.Ignition
8687
dst.Spec.Template.Spec.InstanceMetadataOptions = restored.Spec.Template.Spec.InstanceMetadataOptions
8788
dst.Spec.Template.Spec.PlacementGroupName = restored.Spec.Template.Spec.PlacementGroupName
89+
dst.Spec.Template.Spec.PrivateDNSNameOptions = restored.Spec.Template.Spec.PrivateDNSNameOptions
8890

8991
return nil
9092
}

api/v1beta1/zz_generated.conversion.go

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

api/v1beta2/awsmachine_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ type AWSMachineSpec struct {
161161
// +kubebuilder:validation:Enum:=default;dedicated;host
162162
Tenancy string `json:"tenancy,omitempty"`
163163

164-
// PrivateDnsNameOptions is the options for the instance hostname.
164+
// PrivateDNSNameOptions is the options for the instance hostname.
165165
// +optional
166-
PrivateDnsNameOptions *PrivateDnsNameOptions `json:"privateDnsNameOptions,omitempty"`
166+
PrivateDNSNameOptions *PrivateDNSNameOptions `json:"privateDnsNameOptions,omitempty"`
167167
}
168168

169169
// CloudInit defines options related to the bootstrapping systems where

api/v1beta2/awsmachine_webhook.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ func (r *AWSMachine) ValidateUpdate(old runtime.Object) (admission.Warnings, err
114114
delete(cloudInit, "secureSecretsBackend")
115115
}
116116

117-
// allow changes to enableResourceNameDnsAAAARecord and enableResourceNameDnsARecord
118-
if privateDnsNameOptions, ok := oldAWSMachineSpec["privateDnsNameOptions"].(map[string]interface{}); ok {
119-
delete(privateDnsNameOptions, "enableResourceNameDnsAAAARecord")
120-
delete(privateDnsNameOptions, "enableResourceNameDnsARecord")
117+
// allow changes to enableResourceNameDNSAAAARecord and enableResourceNameDNSARecord
118+
if privateDNSNameOptions, ok := oldAWSMachineSpec["privateDnsNameOptions"].(map[string]interface{}); ok {
119+
delete(privateDNSNameOptions, "enableResourceNameDnsAAAARecord")
120+
delete(privateDNSNameOptions, "enableResourceNameDnsARecord")
121121
}
122122

123-
if privateDnsNameOptions, ok := newAWSMachineSpec["privateDnsNameOptions"].(map[string]interface{}); ok {
124-
delete(privateDnsNameOptions, "enableResourceNameDnsAAAARecord")
125-
delete(privateDnsNameOptions, "enableResourceNameDnsARecord")
123+
if privateDNSNameOptions, ok := newAWSMachineSpec["privateDnsNameOptions"].(map[string]interface{}); ok {
124+
delete(privateDNSNameOptions, "enableResourceNameDnsAAAARecord")
125+
delete(privateDNSNameOptions, "enableResourceNameDnsARecord")
126126
}
127127

128128
if !cmp.Equal(oldAWSMachineSpec, newAWSMachineSpec) {

api/v1beta2/awsmachine_webhook_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func TestAWSMachineUpdate(t *testing.T) {
273273
wantErr bool
274274
}{
275275
{
276-
name: "change in providerid, cloudinit, tags, securitygroups and privateDnsNameOptions",
276+
name: "change in providerid, cloudinit, tags, securitygroups",
277277
oldMachine: &AWSMachine{
278278
Spec: AWSMachineSpec{
279279
ProviderID: nil,
@@ -298,10 +298,6 @@ func TestAWSMachineUpdate(t *testing.T) {
298298
SecretPrefix: "test",
299299
SecretCount: 5,
300300
},
301-
PrivateDnsNameOptions: &PrivateDnsNameOptions{
302-
EnableResourceNameDnsAAAARecord: aws.Bool(true),
303-
EnableResourceNameDnsARecord: aws.Bool(true),
304-
},
305301
},
306302
},
307303
wantErr: false,
@@ -329,6 +325,10 @@ func TestAWSMachineUpdate(t *testing.T) {
329325
ID: pointer.String("ID"),
330326
},
331327
},
328+
PrivateDNSNameOptions: &PrivateDNSNameOptions{
329+
EnableResourceNameDNSAAAARecord: aws.Bool(true),
330+
EnableResourceNameDNSARecord: aws.Bool(true),
331+
},
332332
},
333333
},
334334
wantErr: true,

api/v1beta2/network_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ type VPCSpec struct {
336336
// +optional
337337
EmptyRoutesDefaultVPCSecurityGroup bool `json:"emptyRoutesDefaultVPCSecurityGroup,omitempty"`
338338

339-
// PrivateDnsHostnameTypeOnLaunch is the type of hostname to assign to instances in the subnet at launch.
339+
// PrivateDNSHostnameTypeOnLaunch is the type of hostname to assign to instances in the subnet at launch.
340340
// For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name)
341341
// or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).
342342
// +optional
343343
// +kubebuilder:validation:Enum:=ip-name;resource-name
344-
PrivateDnsHostnameTypeOnLaunch *string `json:"privateDnsHostnameTypeOnLaunch,omitempty"`
344+
PrivateDNSHostnameTypeOnLaunch *string `json:"privateDnsHostnameTypeOnLaunch,omitempty"`
345345
}
346346

347347
// String returns a string representation of the VPC.

api/v1beta2/types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ type Instance struct {
233233
// +optional
234234
InstanceMetadataOptions *InstanceMetadataOptions `json:"instanceMetadataOptions,omitempty"`
235235

236-
// PrivateDnsNameOptions is the options for the instance hostname.
236+
// PrivateDNSNameOptions is the options for the instance hostname.
237237
// +optional
238-
PrivateDnsNameOptions *PrivateDnsNameOptions `json:"privateDnsNameOptions,omitempty"`
238+
PrivateDNSNameOptions *PrivateDNSNameOptions `json:"privateDnsNameOptions,omitempty"`
239239
}
240240

241241
// InstanceMetadataState describes the state of InstanceMetadataOptions.HttpEndpoint and InstanceMetadataOptions.InstanceMetadataTags
@@ -412,14 +412,14 @@ const (
412412
AmazonLinuxGPU EKSAMILookupType = "AmazonLinuxGPU"
413413
)
414414

415-
// PrivateDnsNameOptions is the options for the instance hostname.
416-
type PrivateDnsNameOptions struct {
417-
// EnableResourceNameDnsAAAARecord indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
415+
// PrivateDNSNameOptions is the options for the instance hostname.
416+
type PrivateDNSNameOptions struct {
417+
// EnableResourceNameDNSAAAARecord indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
418418
// +optional
419-
EnableResourceNameDnsAAAARecord *bool `json:"enableResourceNameDnsAAAARecord,omitempty"`
420-
// EnableResourceNameDnsARecord indicates whether to respond to DNS queries for instance hostnames with DNS A records.
419+
EnableResourceNameDNSAAAARecord *bool `json:"enableResourceNameDnsAAAARecord,omitempty"`
420+
// EnableResourceNameDNSARecord indicates whether to respond to DNS queries for instance hostnames with DNS A records.
421421
// +optional
422-
EnableResourceNameDnsARecord *bool `json:"enableResourceNameDnsARecord,omitempty"`
422+
EnableResourceNameDNSARecord *bool `json:"enableResourceNameDnsARecord,omitempty"`
423423
// The type of hostname to assign to an instance.
424424
// +optional
425425
// +kubebuilder:validation:Enum:=ip-name;resource-name

api/v1beta2/zz_generated.deepcopy.go

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

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ spec:
648648
type: string
649649
type: object
650650
privateDnsHostnameTypeOnLaunch:
651-
description: PrivateDnsHostnameTypeOnLaunch is the type of
651+
description: PrivateDNSHostnameTypeOnLaunch is the type of
652652
hostname to assign to instances in the subnet at launch.
653653
For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an
654654
instance DNS name can be based on the instance IPv4 address
@@ -1109,16 +1109,16 @@ spec:
11091109
group in which to launch the instance.
11101110
type: string
11111111
privateDnsNameOptions:
1112-
description: PrivateDnsNameOptions is the options for the instance
1112+
description: PrivateDNSNameOptions is the options for the instance
11131113
hostname.
11141114
properties:
11151115
enableResourceNameDnsAAAARecord:
1116-
description: EnableResourceNameDnsAAAARecord indicates whether
1116+
description: EnableResourceNameDNSAAAARecord indicates whether
11171117
to respond to DNS queries for instance hostnames with DNS
11181118
AAAA records.
11191119
type: boolean
11201120
enableResourceNameDnsARecord:
1121-
description: EnableResourceNameDnsARecord indicates whether
1121+
description: EnableResourceNameDNSARecord indicates whether
11221122
to respond to DNS queries for instance hostnames with DNS
11231123
A records.
11241124
type: boolean
@@ -2278,7 +2278,7 @@ spec:
22782278
type: string
22792279
type: object
22802280
privateDnsHostnameTypeOnLaunch:
2281-
description: PrivateDnsHostnameTypeOnLaunch is the type of
2281+
description: PrivateDNSHostnameTypeOnLaunch is the type of
22822282
hostname to assign to instances in the subnet at launch.
22832283
For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an
22842284
instance DNS name can be based on the instance IPv4 address
@@ -2752,16 +2752,16 @@ spec:
27522752
group in which to launch the instance.
27532753
type: string
27542754
privateDnsNameOptions:
2755-
description: PrivateDnsNameOptions is the options for the instance
2755+
description: PrivateDNSNameOptions is the options for the instance
27562756
hostname.
27572757
properties:
27582758
enableResourceNameDnsAAAARecord:
2759-
description: EnableResourceNameDnsAAAARecord indicates whether
2759+
description: EnableResourceNameDNSAAAARecord indicates whether
27602760
to respond to DNS queries for instance hostnames with DNS
27612761
AAAA records.
27622762
type: boolean
27632763
enableResourceNameDnsARecord:
2764-
description: EnableResourceNameDnsARecord indicates whether
2764+
description: EnableResourceNameDNSARecord indicates whether
27652765
to respond to DNS queries for instance hostnames with DNS
27662766
A records.
27672767
type: boolean

0 commit comments

Comments
 (0)