Skip to content

Commit 34f5ac9

Browse files
author
lukasmetzner
committed
chore: Removed intermediate features for mock staging/unstaging in Docker swarm
With the merge of moby/swarmkit#3116 the mock staging/unstaging is not needed anymore. It was introduced in our csi-driver in this commit: 619fa5c. Which is part of a large PR (squashed commit) that included experimental support for Docker swarm.
1 parent a132c79 commit 34f5ac9

File tree

1 file changed

+15
-38
lines changed

1 file changed

+15
-38
lines changed

internal/driver/node.go

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package driver
33
import (
44
"context"
55
"fmt"
6-
"os"
76

87
proto "github.com/container-storage-interface/spec/lib/go/csi"
98
"github.com/go-kit/log"
@@ -22,11 +21,6 @@ type NodeService struct {
2221
volumeMountService volumes.MountService
2322
volumeResizeService volumes.ResizeService
2423
volumeStatsService volumes.StatsService
25-
// enable volume staging api to workaround
26-
// docker CSI support not working properly
27-
// if a plugin does not support staging
28-
// see https://github.com/moby/swarmkit/pull/3116
29-
forceVolumeStaging bool
3024
}
3125

3226
func NewNodeService(
@@ -44,20 +38,17 @@ func NewNodeService(
4438
volumeMountService: volumeMountService,
4539
volumeResizeService: volumeResizeService,
4640
volumeStatsService: volumeStatsService,
47-
forceVolumeStaging: os.Getenv("FORCE_STAGING_SUPPORT") == "true",
4841
}
4942
}
5043

5144
const encryptionPassphraseKey = "encryption-passphrase"
5245

5346
func (s *NodeService) NodeStageVolume(_ context.Context, _ *proto.NodeStageVolumeRequest) (*proto.NodeStageVolumeResponse, error) {
54-
// while we dont do anything here, Swarm 23.0.1 might require this
55-
return &proto.NodeStageVolumeResponse{}, nil
47+
return nil, status.Error(codes.Unimplemented, "not supported")
5648
}
5749

5850
func (s *NodeService) NodeUnstageVolume(_ context.Context, _ *proto.NodeUnstageVolumeRequest) (*proto.NodeUnstageVolumeResponse, error) {
59-
// while we dont do anything here, Swarm 23.0.1 might require this
60-
return &proto.NodeUnstageVolumeResponse{}, nil
51+
return nil, status.Error(codes.Unimplemented, "not supported")
6152
}
6253

6354
func (s *NodeService) NodePublishVolume(_ context.Context, req *proto.NodePublishVolumeRequest) (*proto.NodePublishVolumeResponse, error) {
@@ -159,38 +150,24 @@ func (s *NodeService) NodeGetVolumeStats(_ context.Context, req *proto.NodeGetVo
159150
}
160151

161152
func (s *NodeService) NodeGetCapabilities(_ context.Context, _ *proto.NodeGetCapabilitiesRequest) (*proto.NodeGetCapabilitiesResponse, error) {
162-
capabilities := []*proto.NodeServiceCapability{
163-
{
164-
Type: &proto.NodeServiceCapability_Rpc{
165-
Rpc: &proto.NodeServiceCapability_RPC{
166-
Type: proto.NodeServiceCapability_RPC_EXPAND_VOLUME,
153+
return &proto.NodeGetCapabilitiesResponse{
154+
Capabilities: []*proto.NodeServiceCapability{
155+
{
156+
Type: &proto.NodeServiceCapability_Rpc{
157+
Rpc: &proto.NodeServiceCapability_RPC{
158+
Type: proto.NodeServiceCapability_RPC_EXPAND_VOLUME,
159+
},
167160
},
168161
},
169-
},
170-
{
171-
Type: &proto.NodeServiceCapability_Rpc{
172-
Rpc: &proto.NodeServiceCapability_RPC{
173-
Type: proto.NodeServiceCapability_RPC_GET_VOLUME_STATS,
162+
{
163+
Type: &proto.NodeServiceCapability_Rpc{
164+
Rpc: &proto.NodeServiceCapability_RPC{
165+
Type: proto.NodeServiceCapability_RPC_GET_VOLUME_STATS,
166+
},
174167
},
175168
},
176169
},
177-
}
178-
179-
if s.forceVolumeStaging {
180-
capabilities = append(capabilities, &proto.NodeServiceCapability{
181-
Type: &proto.NodeServiceCapability_Rpc{
182-
Rpc: &proto.NodeServiceCapability_RPC{
183-
Type: proto.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME,
184-
},
185-
},
186-
})
187-
}
188-
189-
resp := &proto.NodeGetCapabilitiesResponse{
190-
Capabilities: capabilities,
191-
}
192-
193-
return resp, nil
170+
}, nil
194171
}
195172

196173
func (s *NodeService) NodeGetInfo(_ context.Context, _ *proto.NodeGetInfoRequest) (*proto.NodeGetInfoResponse, error) {

0 commit comments

Comments
 (0)