Skip to content

Commit

Permalink
Merge pull request #16285 from justinsb/toolbox_dump_target_groups
Browse files Browse the repository at this point in the history
toolbox dump: output correct type for target groups
  • Loading branch information
k8s-ci-robot authored Jan 27, 2024
2 parents a10595f + 2fb39de commit b5675db
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/resources/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,15 @@ func DescribeELBV2s(cloud fi.Cloud) ([]*elbv2.LoadBalancer, map[string][]*elbv2.
return elbv2s, elbv2Tags, nil
}

func DumpTargetGroup(op *resources.DumpOperation, r *resources.Resource) error {
data := make(map[string]interface{})
data["id"] = r.ID
data["type"] = TypeTargetGroup
data["raw"] = r.Obj
op.Dump.Resources = append(op.Dump.Resources, data)
return nil
}

func ListTargetGroups(cloud fi.Cloud, vpcID, clusterName string) ([]*resources.Resource, error) {
targetgroups, _, err := DescribeTargetGroups(cloud)
if err != nil {
Expand All @@ -1673,7 +1682,7 @@ func ListTargetGroups(cloud fi.Cloud, vpcID, clusterName string) ([]*resources.R
ID: string(*tg.TargetGroupArn),
Type: TypeTargetGroup,
Deleter: DeleteTargetGroup,
Dumper: DumpELB,
Dumper: DumpTargetGroup,
Obj: tg,
}

Expand Down

0 comments on commit b5675db

Please sign in to comment.