From 21aa7641546400627bbd33328b2d83aa857dacc0 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 24 Feb 2022 14:17:15 -0500 Subject: [PATCH] CSI: ensure all fields are mapped from structs to api response (#12124) In PR #12108 we added missing fields to the plugin response, but we didn't include the manual serialization steps that we need until issue #10470 is resolved. --- command/agent/csi_endpoint.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/command/agent/csi_endpoint.go b/command/agent/csi_endpoint.go index 34e20e3bb..0a3bd0433 100644 --- a/command/agent/csi_endpoint.go +++ b/command/agent/csi_endpoint.go @@ -545,11 +545,20 @@ func structsCSIInfoToApi(info *structs.CSIInfo) *api.CSIInfo { } if info.ControllerInfo != nil { + ci := info.ControllerInfo out.ControllerInfo = &api.CSIControllerInfo{ - SupportsReadOnlyAttach: info.ControllerInfo.SupportsReadOnlyAttach, - SupportsAttachDetach: info.ControllerInfo.SupportsAttachDetach, - SupportsListVolumes: info.ControllerInfo.SupportsListVolumes, - SupportsListVolumesAttachedNodes: info.ControllerInfo.SupportsListVolumesAttachedNodes, + SupportsCreateDelete: ci.SupportsCreateDelete, + SupportsAttachDetach: ci.SupportsAttachDetach, + SupportsListVolumes: ci.SupportsListVolumes, + SupportsGetCapacity: ci.SupportsGetCapacity, + SupportsCreateDeleteSnapshot: ci.SupportsCreateDeleteSnapshot, + SupportsListSnapshots: ci.SupportsListSnapshots, + SupportsClone: ci.SupportsClone, + SupportsReadOnlyAttach: ci.SupportsReadOnlyAttach, + SupportsExpand: ci.SupportsExpand, + SupportsListVolumesAttachedNodes: ci.SupportsListVolumesAttachedNodes, + SupportsCondition: ci.SupportsCondition, + SupportsGet: ci.SupportsGet, } } @@ -558,6 +567,9 @@ func structsCSIInfoToApi(info *structs.CSIInfo) *api.CSIInfo { ID: info.NodeInfo.ID, MaxVolumes: info.NodeInfo.MaxVolumes, RequiresNodeStageVolume: info.NodeInfo.RequiresNodeStageVolume, + SupportsStats: info.NodeInfo.SupportsStats, + SupportsExpand: info.NodeInfo.SupportsExpand, + SupportsCondition: info.NodeInfo.SupportsCondition, } if info.NodeInfo.AccessibleTopology != nil {