Skip to content

Commit 69860a8

Browse files
authored
Merge pull request #42 from civo/update-civogo-v0.3.92
Fix: CSI - Update to conform to latest civogo client code changes
2 parents 1d20f22 + 88a4805 commit 69860a8

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22
44

55
require (
66
github.com/BurntSushi/toml v0.3.1
7-
github.com/civo/civogo v0.3.67
7+
github.com/civo/civogo v0.3.92
88
github.com/container-storage-interface/spec v1.6.0
99
github.com/golang/protobuf v1.5.4
1010
github.com/joho/godotenv v1.4.0

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
1414
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
1515
github.com/civo/civogo v0.3.67 h1:R6MepF20Od7KQdcEKpr3GD8zKy1Jly0SuBDubZkEU2s=
1616
github.com/civo/civogo v0.3.67/go.mod h1:S/iYmGvQOraxdRtcXeq/2mVX01/ia2qfpQUp2SsTLKA=
17+
github.com/civo/civogo v0.3.92 h1:fiA9nsyvEU9vVwA8ssIDSGt6gsWs6meqgaKrimAEaI0=
18+
github.com/civo/civogo v0.3.92/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM=
1719
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
1820
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
1921
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=

pkg/driver/controller_server.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,13 @@ func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.Controlle
293293
Str("volume_status", volume.Status).
294294
Str("reqested_instance_id", req.NodeId).
295295
Msg("Requesting volume to be attached in Civo API")
296-
_, err = d.CivoClient.AttachVolume(req.VolumeId, req.NodeId)
296+
297+
volConfig := civogo.VolumeAttachConfig{
298+
InstanceID: req.NodeId,
299+
Region: d.Region,
300+
}
301+
302+
_, err = d.CivoClient.AttachVolume(req.VolumeId, volConfig)
297303
if err != nil {
298304
log.Error().Err(err).Msg("Unable to attach volume in Civo API")
299305
return nil, err

pkg/driver/controller_server_test.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ func TestControllerUnpublishVolume(t *testing.T) {
163163
})
164164
assert.Nil(t, err)
165165

166-
_, err = d.CivoClient.AttachVolume(volume.ID, "instance-1")
166+
volConfig := civogo.VolumeAttachConfig{
167+
InstanceID: "instance-1",
168+
Region: d.Region,
169+
}
170+
171+
_, err = d.CivoClient.AttachVolume(volume.ID, volConfig)
167172
assert.Nil(t, err)
168173

169174
_, err = d.ControllerUnpublishVolume(context.Background(), &csi.ControllerUnpublishVolumeRequest{
@@ -185,7 +190,11 @@ func TestControllerUnpublishVolume(t *testing.T) {
185190
})
186191
assert.Nil(t, err)
187192

188-
_, err = d.CivoClient.AttachVolume(volume.ID, "other-instance")
193+
volConfig := civogo.VolumeAttachConfig{
194+
InstanceID: "other-instance",
195+
Region: d.Region,
196+
}
197+
_, err = d.CivoClient.AttachVolume(volume.ID, volConfig)
189198
assert.Nil(t, err)
190199

191200
_, err = d.ControllerUnpublishVolume(context.Background(), &csi.ControllerUnpublishVolumeRequest{

0 commit comments

Comments
 (0)