Skip to content

Commit e2a9338

Browse files
authored
add DPD and IO to initialisms (#147)
Issue #, if available: [#889](aws-controllers-k8s/community#889) Description of changes: * Adding DPD and IO to initialisms after generating vpc resource for ec2-controller * Update unit test Testing: * make test ✅ * make build controller SERVICE=ec2 ✅ ``` // The VPN tunnel options. type TunnelOption struct { DPDTimeoutAction *string `json:"dpdTimeoutAction,omitempty"` ... } type VolumeStatusAttachmentStatus struct { InstanceID *string `json:"instanceID,omitempty"` IOPerformance *string `json:"ioPerformance,omitempty"` ... } ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 843e3dd commit e2a9338

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/names/names.go

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ var (
8181
{"Cpu", "CPU", "cpu", nil},
8282
{"Dhcp", "DHCP", "dhcp", nil},
8383
{"Dns", "DNS", "dns", nil},
84+
{"Dpd", "DPD", "dpd", nil},
8485
{"Ebs", "EBS", "ebs", nil},
8586
{"Ec2", "EC2", "ec2", nil},
8687
{"Ecr", "ECR", "ecr", nil},
@@ -93,6 +94,8 @@ var (
9394
{"Https", "HTTPS", "https", nil},
9495
{"Iam", "IAM", "iam", nil},
9596
{"Icmp", "ICMP", "icmp", nil},
97+
// Prevent "IOPS" from becoming "IOps"
98+
{"Io", "IO", "io", regexp.MustCompile("Io(?!ps)", regexp.None)},
9699
{"Iops", "IOPS", "iops", nil},
97100
{"Json", "JSON", "json", nil},
98101
{"Jwt", "JWT", "jwt", nil},

pkg/names/names_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ func TestNames(t *testing.T) {
5050
{"MultipartUpload", "MultipartUpload", "multipartUpload", "multipart_upload"},
5151
{"Package", "Package", "package_", "package_"},
5252
{"LdapServerMetadata", "LDAPServerMetadata", "ldapServerMetadata", "ldap_server_metadata"},
53+
{"DpdTimeoutAction", "DPDTimeoutAction", "dpdTimeoutAction", "dpd_timeout_action"},
54+
{"Iops", "IOPS", "iops", "iops"},
55+
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
5356
}
5457
for _, tc := range testCases {
5558
n := names.New(tc.original)

0 commit comments

Comments
 (0)