diff --git a/v1/instance.go b/v1/instance.go index 0a9b7b2..cb10640 100644 --- a/v1/instance.go +++ b/v1/instance.go @@ -11,6 +11,7 @@ import ( type CloudInstanceReader interface { GetInstance(ctx context.Context, id CloudProviderInstanceID) (*Instance, error) ListInstances(ctx context.Context, args ListInstancesArgs) ([]Instance, error) + GetInstancePollTime() time.Duration } type CloudCreateTerminateInstance interface { diff --git a/v1/notimplemented.go b/v1/notimplemented.go index 84fe74f..2724cf8 100644 --- a/v1/notimplemented.go +++ b/v1/notimplemented.go @@ -43,6 +43,11 @@ func (c notImplCloudClient) GetInstanceTypePollTime() time.Duration { return pollTime } +func (c notImplCloudClient) GetInstancePollTime() time.Duration { + pollTime := 5 * time.Second + return pollTime +} + func (c notImplCloudClient) CreateInstance(_ context.Context, _ CreateInstanceAttrs) (*Instance, error) { return nil, ErrNotImplemented } diff --git a/v1/waiters_test.go b/v1/waiters_test.go index 3339253..665f09f 100644 --- a/v1/waiters_test.go +++ b/v1/waiters_test.go @@ -78,6 +78,10 @@ func (m *mockCloudInstanceReader) ListInstances(_ context.Context, _ ListInstanc return nil, nil } +func (m *mockCloudInstanceReader) GetInstancePollTime() time.Duration { + return 5 * time.Second +} + // setStatusSequence sets up a sequence of statuses that will be returned for an instance func (m *mockCloudInstanceReader) setStatusSequence(instanceID CloudProviderInstanceID, sequence []LifecycleStatus) { m.statusSequence[instanceID] = sequence