Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/generate/code/resource_reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ func Test_ReferenceFieldsPresent_NestedSliceOfStructsReference(t *testing.T) {
require.NotNil(crd)
expected :=
`if ko.Spec.Routes != nil {
for _, iter32 := range ko.Spec.Routes {
if iter32.GatewayRef != nil {
for _, iter35 := range ko.Spec.Routes {
if iter35.GatewayRef != nil {
Comment on lines +185 to +186
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. Did this start failing just because the api-2.json was super out of date?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, some fields were added to CreateRoute:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh cool cool cool yep

return true
}
}
}
if ko.Spec.Routes != nil {
for _, iter35 := range ko.Spec.Routes {
if iter35.NATGatewayRef != nil {
for _, iter38 := range ko.Spec.Routes {
if iter38.NATGatewayRef != nil {
return true
}
}
Expand Down
16 changes: 16 additions & 0 deletions pkg/generate/code/set_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3066,6 +3066,22 @@ func TestSetResource_EC2_SecurityGroups_SetResourceIdentifiers(t *testing.T) {
} else {
ko.Status.ID = nil
}
if resp.Tags != nil {
f1 := []*svcapitypes.Tag{}
for _, f1iter := range resp.Tags {
f1elem := &svcapitypes.Tag{}
if f1iter.Key != nil {
f1elem.Key = f1iter.Key
}
if f1iter.Value != nil {
f1elem.Value = f1iter.Value
}
f1 = append(f1, f1elem)
}
ko.Status.Tags = f1
} else {
ko.Status.Tags = nil
}
`
assert.Equal(
expected,
Expand Down
467 changes: 341 additions & 126 deletions pkg/generate/code/set_sdk_test.go

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pkg/model/model_ec2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ import (
"strings"
"testing"

"github.com/aws-controllers-k8s/code-generator/pkg/model"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/aws-controllers-k8s/code-generator/pkg/model"
"github.com/aws-controllers-k8s/code-generator/pkg/testutil"
)

Expand Down Expand Up @@ -126,6 +125,7 @@ func TestEC2_Volume(t *testing.T) {

expSpecFieldCamel := []string{
"AvailabilityZone",
"ClientToken",
"DryRun",
"Encrypted",
"IOPS",
Expand All @@ -135,6 +135,7 @@ func TestEC2_Volume(t *testing.T) {
"Size",
"SnapshotID",
"TagSpecifications",
"Throughput",
"VolumeType",
}
assert.Equal(expSpecFieldCamel, attrCamelNames(specFields))
Expand Down
Loading