Skip to content

Commit

Permalink
Fix a nil panic error
Browse files Browse the repository at this point in the history
When running this against a test cluster, discovered that the logic must
filter to only names with SDK routes before adding them to a deletion
list.
  • Loading branch information
dhild committed Mar 21, 2024
1 parent 2ec2d6c commit b0ffeb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/virtualrouter/routes_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ func taintedSDKRouteRefs(routes []appmesh.Route, sdkVR *appmeshsdk.VirtualRouter
}
routeNameSet := sets.StringKeySet(routeByName)
sdkRouteRefNameSet := sets.StringKeySet(sdkRouteRefByName)
matchedNameSet := routeNameSet.Intersection(sdkRouteRefNameSet)
unmatchedSDKRouteRefNameSet := sdkRouteRefNameSet.Difference(routeNameSet)

for _, route := range routes {
for _, name := range matchedNameSet.List() {
route := routeByName[name]
if route.TCPRoute != nil && route.TCPRoute.Match != nil && sdkListenerByPort[aws.Int64Value(route.TCPRoute.Match.Port)] != appmesh.PortProtocolTCP {
unmatchedSDKRouteRefNameSet.Insert(route.Name)
} else if route.GRPCRoute != nil && sdkListenerByPort[aws.Int64Value(route.GRPCRoute.Match.Port)] != appmesh.PortProtocolGRPC {
Expand Down

0 comments on commit b0ffeb3

Please sign in to comment.