mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
csi: add VolumeContext to NodeStage/Publish RPCs (#8239)
In #7957 we added support for passing a volume context to the controller RPCs. This is an opaque map that's created by `CreateVolume` or, in Nomad's case, in the volume registration spec. However, we missed passing this field to the `NodeStage` and `NodePublish` RPC, which prevents certain plugins (such as MooseFS) from making node RPCs.
This commit is contained in:
@@ -163,14 +163,18 @@ func (v *volumeManager) stageVolume(ctx context.Context, vol *structs.CSIVolume,
|
||||
return err
|
||||
}
|
||||
|
||||
req := &csi.NodeStageVolumeRequest{
|
||||
ExternalID: vol.RemoteID(),
|
||||
PublishContext: publishContext,
|
||||
StagingTargetPath: pluginStagingPath,
|
||||
VolumeCapability: capability,
|
||||
Secrets: vol.Secrets,
|
||||
VolumeContext: vol.Context,
|
||||
}
|
||||
|
||||
// CSI NodeStageVolume errors for timeout, codes.Unavailable and
|
||||
// codes.ResourceExhausted are retried; all other errors are fatal.
|
||||
return v.plugin.NodeStageVolume(ctx,
|
||||
vol.RemoteID(),
|
||||
publishContext,
|
||||
pluginStagingPath,
|
||||
capability,
|
||||
vol.Secrets,
|
||||
return v.plugin.NodeStageVolume(ctx, req,
|
||||
grpc_retry.WithPerRetryTimeout(DefaultMountActionTimeout),
|
||||
grpc_retry.WithMax(3),
|
||||
grpc_retry.WithBackoff(grpc_retry.BackoffExponential(100*time.Millisecond)),
|
||||
@@ -210,6 +214,7 @@ func (v *volumeManager) publishVolume(ctx context.Context, vol *structs.CSIVolum
|
||||
VolumeCapability: capabilities,
|
||||
Readonly: usage.ReadOnly,
|
||||
Secrets: vol.Secrets,
|
||||
VolumeContext: vol.Context,
|
||||
},
|
||||
grpc_retry.WithPerRetryTimeout(DefaultMountActionTimeout),
|
||||
grpc_retry.WithMax(3),
|
||||
|
||||
Reference in New Issue
Block a user