Skip to content

Commit 053be5c

Browse files
authored
[v18] Backport AutoUpdateBotInstanceReport (#60196)
* MWI: Generate `AutoUpdateBotInstanceReport` resource (#59738) * MWI: Add `tctl` get and delete mappings for `AutoUpdateBotInstanceReport` (#60017) * MWI: Add `teleport_bot_instances` metric (#59774) * MWI: Log on `AutoUpdateBotInstanceReport` generation failure (#60191) * Allow `machineid.AutoUpdateVersionReporter` to shut down correctly (#60219)
1 parent dd5bac1 commit 053be5c

File tree

38 files changed

+1884
-212
lines changed

38 files changed

+1884
-212
lines changed

api/client/client.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,6 +3174,23 @@ func (c *Client) UpsertAutoUpdateAgentReport(ctx context.Context, report *autoup
31743174
return resp, nil
31753175
}
31763176

3177+
// GetAutoUpdateBotInstanceReport gets the singleton auto-update bot report.
3178+
func (c *Client) GetAutoUpdateBotInstanceReport(ctx context.Context) (*autoupdatev1pb.AutoUpdateBotInstanceReport, error) {
3179+
client := autoupdatev1pb.NewAutoUpdateServiceClient(c.conn)
3180+
resp, err := client.GetAutoUpdateBotInstanceReport(ctx, &autoupdatev1pb.GetAutoUpdateBotInstanceReportRequest{})
3181+
if err != nil {
3182+
return nil, trace.Wrap(err)
3183+
}
3184+
return resp, nil
3185+
}
3186+
3187+
// DeleteAutoUpdateBotInstanceReport deletes the singleton auto-update bot instance report.
3188+
func (c *Client) DeleteAutoUpdateBotInstanceReport(ctx context.Context) error {
3189+
client := autoupdatev1pb.NewAutoUpdateServiceClient(c.conn)
3190+
_, err := client.DeleteAutoUpdateBotInstanceReport(ctx, &autoupdatev1pb.DeleteAutoUpdateBotInstanceReportRequest{})
3191+
return trace.Wrap(err)
3192+
}
3193+
31773194
// GetClusterAccessGraphConfig retrieves the Cluster Access Graph configuration from Auth server.
31783195
func (c *Client) GetClusterAccessGraphConfig(ctx context.Context) (*clusterconfigpb.AccessGraphConfig, error) {
31793196
rsp, err := c.ClusterConfigClient().GetClusterAccessGraphConfig(ctx, &clusterconfigpb.GetClusterAccessGraphConfigRequest{})

api/client/events.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ func EventToGRPC(in types.Event) (*proto.Event, error) {
129129
out.Resource = &proto.Event_AutoUpdateAgentReport{
130130
AutoUpdateAgentReport: r.UnwrapT(),
131131
}
132+
case types.Resource153UnwrapperT[*autoupdate.AutoUpdateBotInstanceReport]:
133+
out.Resource = &proto.Event_AutoUpdateBotInstanceReport{
134+
AutoUpdateBotInstanceReport: r.UnwrapT(),
135+
}
132136
case types.Resource153UnwrapperT[*scopedaccessv1.ScopedRole]:
133137
out.Resource = &proto.Event_ScopedRole{
134138
ScopedRole: r.UnwrapT(),
@@ -629,6 +633,9 @@ func EventFromGRPC(in *proto.Event) (*types.Event, error) {
629633
} else if r := in.GetAutoUpdateAgentReport(); r != nil {
630634
out.Resource = types.Resource153ToLegacy(r)
631635
return &out, nil
636+
} else if r := in.GetAutoUpdateBotInstanceReport(); r != nil {
637+
out.Resource = types.Resource153ToLegacy(r)
638+
return &out, nil
632639
} else if r := in.GetScopedRole(); r != nil {
633640
out.Resource = types.Resource153ToLegacy(r)
634641
return &out, nil

api/client/proto/event.pb.go

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

0 commit comments

Comments
 (0)