Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

Commit 4ca069d

Browse files
authored
Merge pull request #54 from oracle/kj-oci-go-sdk
Update to use the oci-go-sdk
2 parents a2fe516 + 0a738b9 commit 4ca069d

File tree

785 files changed

+46125
-63740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

785 files changed

+46125
-63740
lines changed

Gopkg.lock

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
# version = "2.4.0"
2222

2323

24-
[[constraint]]
25-
branch = "master"
26-
name = "github.com/oracle/bmcs-go-sdk"
27-
2824
[[constraint]]
2925
branch = "master"
3026
name = "k8s.io/utils"

pkg/flexvolume/flexvolume.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ func ExecDriver(driver Driver, args []string) {
230230

231231
ExitWithResult(driver.MountDevice(mountDir, mountDevice, opts))
232232

233-
// <driver executable> unmountdevice <mount device>
233+
// <driver executable> unmountdevice <mount dir>
234234
case "unmountdevice":
235235
if len(args) != 3 {
236236
ExitWithResult(Fail("unmountdevice expected exactly 3 arguments; got ", args))
237237
}
238238

239-
mountDevice := args[2]
240-
ExitWithResult(driver.UnmountDevice(mountDevice))
239+
mountDir := args[2]
240+
ExitWithResult(driver.UnmountDevice(mountDir))
241241

242242
// <driver executable> mount <mount dir> <json options>
243243
case "mount":

pkg/oci/client/cache/ocicache.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import (
2020
"os"
2121
"syscall"
2222

23-
baremetal "github.com/oracle/bmcs-go-sdk"
23+
"github.com/oracle/oci-go-sdk/core"
2424
)
2525

2626
type OCICache struct {
27-
vnics map[string]baremetal.Vnic
27+
vnics map[string]core.Vnic
2828
file *os.File
2929
filename string
3030
}
@@ -41,7 +41,7 @@ func Open(filename string) (*OCICache, error) {
4141
log.Printf("Failed to lock cache: %v", err)
4242
return nil, err
4343
}
44-
var vnicCache = map[string]baremetal.Vnic{}
44+
var vnicCache = map[string]core.Vnic{}
4545
decoder := json.NewDecoder(file)
4646
err = decoder.Decode(&vnicCache)
4747
if err != nil {
@@ -51,13 +51,13 @@ func Open(filename string) (*OCICache, error) {
5151
}
5252

5353
// GetVnic looks up the vnic id in the cache
54-
func (nc *OCICache) GetVnic(id string) (*baremetal.Vnic, bool) {
54+
func (nc *OCICache) GetVnic(id string) (*core.Vnic, bool) {
5555
value, ok := nc.vnics[id]
5656
return &value, ok
5757
}
5858

5959
// SetVnic adds a vnic to the cache
60-
func (nc *OCICache) SetVnic(id string, value *baremetal.Vnic) {
60+
func (nc *OCICache) SetVnic(id string, value *core.Vnic) {
6161
nc.vnics[id] = *value
6262
}
6363

pkg/oci/client/cache/ocicache_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ import (
1919
"math/rand"
2020
"os"
2121
"path/filepath"
22+
"reflect"
2223
"testing"
2324

24-
baremetal "github.com/oracle/bmcs-go-sdk"
25+
"github.com/oracle/oci-go-sdk/core"
2526
)
2627

2728
func TempFileName(prefix, suffix string) string {
@@ -39,7 +40,8 @@ func TestCache(t *testing.T) {
3940
}
4041
defer cache.Close()
4142

42-
var testVnic = baremetal.Vnic{ID: "test"}
43+
id := "test"
44+
var testVnic = core.Vnic{Id: &id}
4345
cache.SetVnic("test", &testVnic)
4446
value, ok := cache.GetVnic("test")
4547
if !ok {
@@ -80,7 +82,8 @@ func TestCacheLoadSave(t *testing.T) {
8082
t.Error(err)
8183
}
8284
defer firstCache.Close()
83-
var testVnic = baremetal.Vnic{ID: "test"}
85+
id := "test"
86+
var testVnic = core.Vnic{Id: &id}
8487
firstCache.SetVnic("test", &testVnic)
8588
value, ok := firstCache.GetVnic("test")
8689
if !ok {
@@ -101,7 +104,8 @@ func TestCacheLoadSave(t *testing.T) {
101104
if !ok {
102105
t.Error("test not found")
103106
}
104-
if *value != testVnic {
107+
108+
if !reflect.DeepEqual(*value, testVnic) {
105109
t.Error("Key not equal to test")
106110
}
107111
err = otherCache.Close()
@@ -119,7 +123,8 @@ func TestCacheParallel(t *testing.T) {
119123
t.Error(err)
120124
}
121125
defer cache.Close()
122-
var testVnic = baremetal.Vnic{ID: "test"}
126+
id := "test"
127+
var testVnic = core.Vnic{Id: &id}
123128
cache.SetVnic("test", &testVnic)
124129
value, ok := cache.GetVnic("test")
125130
if !ok {

0 commit comments

Comments
 (0)