14324: Azure driver for crunch-dispatch-cloud
[arvados.git] / lib / dispatchcloud / test / lame_instance_set.go
index baab407a7d0e89c2eee7bbfecae71d4e58cbdb70..c52f7c645cd672bb1ecf6f212aab49d1bf58dfd0 100644 (file)
@@ -5,6 +5,7 @@
 package test
 
 import (
+       "context"
        "fmt"
        "math/rand"
        "sync"
@@ -24,13 +25,13 @@ type LameInstanceSet struct {
 }
 
 // Create returns a new instance.
-func (p *LameInstanceSet) Create(instType arvados.InstanceType, imageID cloud.ImageID, tags cloud.InstanceTags, pubkey ssh.PublicKey) (cloud.Instance, error) {
+func (p *LameInstanceSet) Create(_ context.Context, instType arvados.InstanceType, imageID cloud.ImageID, tags cloud.InstanceTags, pubkey ssh.PublicKey) (cloud.Instance, error) {
        inst := &lameInstance{
                p:            p,
                id:           cloud.InstanceID(fmt.Sprintf("lame-%x", rand.Uint64())),
                providerType: instType.ProviderType,
        }
-       inst.SetTags(tags)
+       inst.SetTags(context.TODO(), tags)
        if p.Hold != nil {
                p.Hold <- true
        }
@@ -44,7 +45,7 @@ func (p *LameInstanceSet) Create(instType arvados.InstanceType, imageID cloud.Im
 }
 
 // Instances returns the instances that haven't been destroyed.
-func (p *LameInstanceSet) Instances(cloud.InstanceTags) ([]cloud.Instance, error) {
+func (p *LameInstanceSet) Instances(context.Context, cloud.InstanceTags) ([]cloud.Instance, error) {
        p.mtx.Lock()
        defer p.mtx.Unlock()
        var instances []cloud.Instance
@@ -89,7 +90,7 @@ func (inst *lameInstance) Address() string {
        return "0.0.0.0:1234"
 }
 
-func (inst *lameInstance) SetTags(tags cloud.InstanceTags) error {
+func (inst *lameInstance) SetTags(_ context.Context, tags cloud.InstanceTags) error {
        inst.p.mtx.Lock()
        defer inst.p.mtx.Unlock()
        inst.tags = cloud.InstanceTags{}
@@ -99,7 +100,7 @@ func (inst *lameInstance) SetTags(tags cloud.InstanceTags) error {
        return nil
 }
 
-func (inst *lameInstance) Destroy() error {
+func (inst *lameInstance) Destroy(context.Context) error {
        if inst.p.Hold != nil {
                inst.p.Hold <- true
        }
@@ -113,6 +114,6 @@ func (inst *lameInstance) Tags() cloud.InstanceTags {
        return inst.tags
 }
 
-func (inst *lameInstance) VerifyHostKey(ssh.PublicKey, *ssh.Client) error {
+func (inst *lameInstance) VerifyHostKey(context.Context, ssh.PublicKey, *ssh.Client) error {
        return nil
 }