Skip to content

Commit 5ee5632

Browse files
author
Nishant Burte
committed
Route addition in routeTable changes CR spec
This fix accomodates an aws api bug so as to prevent routeTable CR spec from changing. Details explained in the issue description.
1 parent 9964ead commit 5ee5632

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2023-12-12T12:34:35Z"
2+
build_date: "2023-12-15T06:34:46Z"
33
build_hash: 3653329ceeb20015851b8776a6061a3fb0ec2935
4-
go_version: go1.21.0
5-
version: "3653329"
4+
go_version: go1.21.1
5+
version: v0.27.1-6-g3653329
66
api_directory_checksum: d452bf19bfd1496aacdc215bf7cc9ea86c55c122
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: df1057de840147701c11acfdbed0e28e9b0ddd96
10+
file_checksum: 0ea278e11a33d237e88a1bcdca878656a8ba43f9
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

pkg/resource/route_table/sdk.go

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

templates/hooks/route_table/sdk_read_many_post_set_output.go.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@
99
ko.Spec.Tags = r.ko.Spec.Tags
1010
}
1111

12+
// Even if route is created with arguments as VPCEndpointID,
13+
// when aws api is called to describe the route (inside skdFind), it
14+
// returns VPCEndpointID as GatewayID. Due to this bug, spec section for
15+
// routes is populated incorrectly in above auto-gen code.
16+
// To solve this, if 'GatewayID' has prefix 'vpce-', then the entry is
17+
// moved from 'GatewayID' to 'VPCEndpointID'.
18+
for i, route := range ko.Spec.Routes {
19+
if route.GatewayID != nil && strings.HasPrefix(*route.GatewayID, "vpce-") {
20+
ko.Spec.Routes[i].VPCEndpointID = route.GatewayID
21+
ko.Spec.Routes[i].GatewayID = nil
22+
}
23+
}

0 commit comments

Comments
 (0)