cloud/shepherd/equinix/wrapngo: allow specifying options when getting device
Change-Id: Ib1f4a88d1a45d9c0da1c56bd8ee21bf18302d9f8
Reviewed-on: https://review.monogon.dev/c/monogon/+/1576
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/cloud/shepherd/equinix/wrapngo/wrapn.go b/cloud/shepherd/equinix/wrapngo/wrapn.go
index dc54340..4bdc314 100644
--- a/cloud/shepherd/equinix/wrapngo/wrapn.go
+++ b/cloud/shepherd/equinix/wrapngo/wrapn.go
@@ -86,7 +86,9 @@
// is provided to allow for dependency injection of a fake equinix API for tests.
type Client interface {
// GetDevice wraps packngo's cl.Devices.Get.
- GetDevice(ctx context.Context, pid, did string) (*packngo.Device, error)
+ //
+ // TODO(q3k): remove unused pid parameter.
+ GetDevice(ctx context.Context, pid, did string, opts *packngo.ListOptions) (*packngo.Device, error)
// ListDevices wraps packngo's cl.Device.List.
ListDevices(ctx context.Context, pid string) ([]packngo.Device, error)
// CreateDevice attempts to create a new device according to the provided
@@ -220,9 +222,9 @@
})
}
-func (e *client) GetDevice(ctx context.Context, pid, did string) (*packngo.Device, error) {
+func (e *client) GetDevice(ctx context.Context, pid, did string, opts *packngo.ListOptions) (*packngo.Device, error) {
return wrap(ctx, e, func(cl *packngo.Client) (*packngo.Device, error) {
- d, _, err := cl.Devices.Get(did, nil)
+ d, _, err := cl.Devices.Get(did, opts)
return d, err
})
}