Skip to content

Commit e0876e4

Browse files
authored
fix controller server (#8)
1 parent 2733dc4 commit e0876e4

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ docker-push: docker-build
1616

1717
.PHONY: docker-build-push
1818
docker-build-push:
19-
docker build -t $(IMAGE):$(TAG) --build-arg VERSION=$(VERSION) . --push
19+
docker build -t $(IMAGE):$(TAG) --build-arg VERSION=$(VERSION) --platform=linux/amd64 . --push

charts/csi-hyperstack/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: csi-hyperstack
33
description: |
44
HELM chart for Hyperstack CSI drvier deployment
55
type: application
6-
version: 0.0.7
7-
appVersion: v0.0.5
6+
version: 0.0.8
7+
appVersion: v0.0.6

pkg/driver/controllerserver.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
202202
if *getVolume.Status == "in-use" {
203203
klog.Infof("ControllerPublishVolume: Volume %s is already in use", *getVolume.Name)
204204
if len(*getVolume.Attachments) > 0 {
205-
attachedInstanceIdStr := *(*getVolume.Attachments)[0].InstanceId
206-
attachedInstanceId, err := strconv.Atoi(attachedInstanceIdStr)
205+
attachedInstanceId := *(*getVolume.Attachments)[0].InstanceId
207206
if err != nil {
208207
klog.Errorf("ControllerPublishVolume: Failed to convert attached instance ID to int: %v", err)
209208
return nil, status.Errorf(codes.Internal, "Failed to convert attached instance ID to int: %v", err)
@@ -266,8 +265,7 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
266265
}
267266
if *v.Status == "in-use" && len(*v.Attachments) > 0 {
268267
attachment := (*v.Attachments)[0]
269-
attachedId, err := strconv.Atoi(*attachment.InstanceId)
270-
if err == nil && attachedId == vmId && attachment.Device != nil {
268+
if err == nil && *attachVolume.Id == vmId && attachment.Device != nil {
271269
klog.Infof("ControllerPublishVolume: Volume attached to correct node with device %s", *attachment.Device)
272270
return &csi.ControllerPublishVolumeResponse{
273271
PublishContext: map[string]string{

0 commit comments

Comments
 (0)