Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbox dump: output correct type for target groups #16285

Merged
merged 1 commit into from
Jan 27, 2024
Merged
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
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