Merge pull request #16073 from justinsb/dump_route_table

toolbox dump: include AWS route table objects
This commit is contained in:
Kubernetes Prow Robot 2023-11-06 15:40:27 +01:00 committed by GitHub
commit f44ee89763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -67,11 +67,22 @@ func ListRouteTables(cloud fi.Cloud, vpcID, clusterName string) ([]*resources.Re
return resourceTrackers, nil
}
func dumpRouteTable(op *resources.DumpOperation, r *resources.Resource) error {
data := make(map[string]interface{})
data["id"] = r.ID
data["type"] = r.Type
data["raw"] = r.Obj
op.Dump.Resources = append(op.Dump.Resources, data)
return nil
}
func buildTrackerForRouteTable(rt *ec2.RouteTable, clusterName string) *resources.Resource {
resourceTracker := &resources.Resource{
Name: FindName(rt.Tags),
ID: aws.StringValue(rt.RouteTableId),
Type: ec2.ResourceTypeRouteTable,
Obj: rt,
Dumper: dumpRouteTable,
Deleter: DeleteRouteTable,
Shared: !HasOwnedTag(ec2.ResourceTypeRouteTable+":"+*rt.RouteTableId, rt.Tags, clusterName),
}