Skip to content

Commit d9b9405

Browse files
author
arbelnat
committed
remove ControllerPublishSupported and NodeStageSupported from Resources type
1 parent da7a71c commit d9b9405

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

pkg/sanity/node.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,9 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
310310
nodeExpansionSupported = isNodeCapabilitySupported(n, csi.NodeServiceCapability_RPC_EXPAND_VOLUME)
311311
controllerExpansionSupported = isControllerCapabilitySupported(cl, csi.ControllerServiceCapability_RPC_EXPAND_VOLUME)
312312
r = &Resources{
313-
Context: sc,
314-
ControllerClient: cl,
315-
NodeClient: n,
316-
ControllerPublishSupported: controllerPublishSupported,
317-
NodeStageSupported: nodeStageSupported,
313+
Context: sc,
314+
ControllerClient: cl,
315+
NodeClient: n,
318316
}
319317
})
320318

pkg/sanity/resources.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ type Resources struct {
6565
// directly if automatic cleanup is not desired and cannot be avoided
6666
// otherwise.
6767
csi.NodeClient
68-
ControllerPublishSupported bool
69-
NodeStageSupported bool
7068

7169
// mutex protects access to managedResourceInfos.
7270
mutex sync.Mutex
@@ -279,7 +277,7 @@ func (cl *Resources) cleanupVolume(ctx context.Context, offset int, volumeID str
279277
errs = append(errs, fmt.Errorf("NodeUnpublishVolume for volume ID %s failed: %s", volumeID, err))
280278
}
281279

282-
if cl.NodeStageSupported {
280+
if isNodeCapabilitySupported(cl, csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME) {
283281
if _, err := cl.NodeUnstageVolume(
284282
ctx,
285283
&csi.NodeUnstageVolumeRequest{
@@ -292,7 +290,7 @@ func (cl *Resources) cleanupVolume(ctx context.Context, offset int, volumeID str
292290
}
293291
}
294292

295-
if cl.ControllerPublishSupported && info.NodeID != "" {
293+
if info.NodeID != "" {
296294
if _, err := cl.ControllerClient.ControllerUnpublishVolume(
297295
ctx,
298296
&csi.ControllerUnpublishVolumeRequest{

0 commit comments

Comments
 (0)