14745: Updates StubDriver to match driver interface and updates vendor.json
authorEric Biagiotti <ebiagiotti@veritasgenetcs.com>
Wed, 13 Feb 2019 18:51:18 +0000 (13:51 -0500)
committerEric Biagiotti <ebiagiotti@veritasgenetcs.com>
Wed, 13 Feb 2019 18:51:18 +0000 (13:51 -0500)
StubDriver InstanceSet was previously using mapstructure to decode DriverParameters into a StubInstanceSet, which doesn't make sense, but mapstructure would just return nil instead of an error.

Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <eric.biagiotti@gmail.com>

lib/dispatchcloud/test/stub_driver.go
vendor/vendor.json

index a2231673fcd08c2230259b915adc41a8f9a3ed58..d90a20c397abdfb63c6ca27198724cc273ab196f 100644 (file)
@@ -6,6 +6,7 @@ package test
 
 import (
        "crypto/rand"
+       "encoding/json"
        "errors"
        "fmt"
        "io"
@@ -17,7 +18,6 @@ import (
 
        "git.curoverse.com/arvados.git/lib/cloud"
        "git.curoverse.com/arvados.git/sdk/go/arvados"
-       "github.com/mitchellh/mapstructure"
        "github.com/sirupsen/logrus"
        "golang.org/x/crypto/ssh"
 )
@@ -55,7 +55,7 @@ type StubDriver struct {
 }
 
 // InstanceSet returns a new *StubInstanceSet.
-func (sd *StubDriver) InstanceSet(params map[string]interface{}, id cloud.InstanceSetID, logger logrus.FieldLogger) (cloud.InstanceSet, error) {
+func (sd *StubDriver) InstanceSet(params json.RawMessage, id cloud.InstanceSetID, logger logrus.FieldLogger) (cloud.InstanceSet, error) {
        if sd.holdCloudOps == nil {
                sd.holdCloudOps = make(chan bool)
        }
@@ -64,7 +64,7 @@ func (sd *StubDriver) InstanceSet(params map[string]interface{}, id cloud.Instan
                servers: map[cloud.InstanceID]*StubVM{},
        }
        sd.instanceSets = append(sd.instanceSets, &sis)
-       return &sis, mapstructure.Decode(params, &sis)
+       return &sis, nil
 }
 
 // InstanceSets returns all instances that have been created by the
index 1b24804b056e2cb2caef666ae695649d935613cd..db69f9fa46832dc36aff1ef20bd176fb7d5c22e5 100644 (file)
                        "revision": "b8bc1bf767474819792c23f32d8286a45736f1c6",
                        "revisionTime": "2016-12-03T19:45:07Z"
                },
-               {
-                       "checksumSHA1": "ewGq4nGalpCQOHcmBTdAEQx1wW0=",
-                       "path": "github.com/mitchellh/mapstructure",
-                       "revision": "bb74f1db0675b241733089d5a1faa5dd8b0ef57b",
-                       "revisionTime": "2018-05-11T14:21:26Z"
-               },
                {
                        "checksumSHA1": "OFNit1Qx2DdWhotfREKodDNUwCM=",
                        "path": "github.com/opencontainers/go-digest",