From 5237ee7bc081925a0cec8e47b4749859c592621b Mon Sep 17 00:00:00 2001 From: Alan Parra Date: Tue, 11 Apr 2023 18:26:18 -0300 Subject: [PATCH] Always return "not implemented" in UpsertDeviceResource --- api/client/client.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/api/client/client.go b/api/client/client.go index 1918e1d4eb03b..2a0d578484aec 100644 --- a/api/client/client.go +++ b/api/client/client.go @@ -655,23 +655,10 @@ func (c *Client) GetDeviceResource(ctx context.Context, id string) (*types.Devic return types.DeviceToResource(dev), nil } -// UpsertDeviceResource creates or updates a device using its resource -// representation. -// Prefer using [DevicesClient] directly if you can. +// UpsertDeviceResource is not supported in Teleport v12 (devices can't be +// updated in this version). func (c *Client) UpsertDeviceResource(ctx context.Context, res *types.DeviceV1) (*types.DeviceV1, error) { - dev, err := types.DeviceFromResource(res) - if err != nil { - return nil, trace.Wrap(err) - } - - upserted, err := c.DevicesClient().UpsertDevice(ctx, &devicepb.UpsertDeviceRequest{ - Device: dev, - CreateAsResource: true, - }, c.callOpts...) - if err != nil { - return nil, trail.FromGRPC(err) - } - return types.DeviceToResource(upserted), nil + return nil, trace.NotImplemented("upsert device not supported in Teleport v12") } // LoginRuleClient returns an unadorned Login Rule client, using the underlying