Skip to content

Commit 95f81d3

Browse files
authored
Add SRIOV and RAM to initialisms (#330)
Issue #, if available: aws-controllers-k8s/ec2-controller#52 Description of changes: * adds `SRIOV` and `RAM` to initialisms with updated tests By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent c2fb48f commit 95f81d3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pkg/generate/code/set_sdk_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ func TestSetSDK_EC2_LaunchTemplate_Create(t *testing.T) {
602602
}
603603
f2.SetPlacement(f2f20)
604604
}
605-
if r.ko.Spec.LaunchTemplateData.RamDiskID != nil {
606-
f2.SetRamDiskId(*r.ko.Spec.LaunchTemplateData.RamDiskID)
605+
if r.ko.Spec.LaunchTemplateData.RAMDiskID != nil {
606+
f2.SetRamDiskId(*r.ko.Spec.LaunchTemplateData.RAMDiskID)
607607
}
608608
if r.ko.Spec.LaunchTemplateData.SecurityGroupIDs != nil {
609609
f2f22 := []*string{}

pkg/names/names.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,13 @@ var (
119119
{"Nat", "NAT", "nat", regexp.MustCompile("Nat(?!i)", regexp.None)},
120120
{"Oidc", "OIDC", "oidc", nil},
121121
{"Ocsp", "OCSP", "ocsp", nil},
122+
// Model fields starting with 'Ram' refer to RAM
123+
{"Ram", "RAM", "ram", regexp.MustCompile("Ram", regexp.None)},
122124
{"Rfc", "RFC", "rfc", nil},
123125
{"Sdk", "SDK", "sdk", nil},
124126
{"Sha256", "SHA256", "sha256", nil},
125127
{"Sqs", "SQS", "sns", nil},
128+
{"Sriov", "SRIOV", "sriov", nil},
126129
{"Sse", "SSE", "sse", nil},
127130
{"Ssl", "SSL", "ssl", nil},
128131
{"Tcp", "TCP", "tcp", nil},

pkg/names/names_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func TestNames(t *testing.T) {
5656
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
5757
{"Iops", "IOPS", "iops", "iops"},
5858
{"Ip", "IP", "ip", "ip"},
59+
{"Frame", "Frame", "frame", "frame"},
5960
{"KeyId", "KeyID", "keyID", "key_id"},
6061
{"KeyID", "KeyID", "keyID", "key_id"},
6162
{"KeyIdentifier", "KeyIdentifier", "keyIdentifier", "key_identifier"},
@@ -67,8 +68,12 @@ func TestNames(t *testing.T) {
6768
{"NativeAuditFieldsIncluded", "NativeAuditFieldsIncluded", "nativeAuditFieldsIncluded", "native_audit_fields_included"},
6869
{"NumberOfAmiToKeep", "NumberOfAMIToKeep", "numberOfAMIToKeep", "number_of_ami_to_keep"},
6970
{"Package", "Package", "package_", "package_"},
71+
{"Param", "Param", "param", "param"},
72+
{"Ram", "RAM", "ram", "ram"},
73+
{"RamDiskId", "RAMDiskID", "ramDiskID", "ram_disk_id"},
7074
{"RepositoryUriTest", "RepositoryURITest", "repositoryURITest", "repository_uri_test"},
7175
{"RequestedAmiVersion", "RequestedAMIVersion", "requestedAMIVersion", "requested_ami_version"},
76+
{"SriovNetSupport", "SRIOVNetSupport", "sriovNetSupport", "sriov_net_support"},
7277
{"SSEKMSKeyID", "SSEKMSKeyID", "sseKMSKeyID", "sse_kms_key_id"},
7378
{"UUID", "UUID", "uuid", "uuid"},
7479
{"Vlan", "VLAN", "vlan", "vlan"},

0 commit comments

Comments
 (0)