util: change member cap of CSIDriver struct

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal 2020-10-21 13:02:19 +05:30 committed by mergify[bot]
parent 25617929f0
commit 5ac3f1e29e
2 changed files with 6 additions and 6 deletions

View File

@ -62,7 +62,7 @@ func (cs *DefaultControllerServer) ControllerGetCapabilities(ctx context.Context
util.TraceLog(ctx, "Using default ControllerGetCapabilities") util.TraceLog(ctx, "Using default ControllerGetCapabilities")
return &csi.ControllerGetCapabilitiesResponse{ return &csi.ControllerGetCapabilitiesResponse{
Capabilities: cs.Driver.cap, Capabilities: cs.Driver.capabilities,
}, nil }, nil
} }

View File

@ -33,9 +33,9 @@ type CSIDriver struct {
nodeID string nodeID string
version string version string
// topology constraints that this nodeserver will advertise // topology constraints that this nodeserver will advertise
topology map[string]string topology map[string]string
cap []*csi.ControllerServiceCapability capabilities []*csi.ControllerServiceCapability
vc []*csi.VolumeCapability_AccessMode vc []*csi.VolumeCapability_AccessMode
} }
// NewCSIDriver Creates a NewCSIDriver object. Assumes vendor // NewCSIDriver Creates a NewCSIDriver object. Assumes vendor
@ -73,7 +73,7 @@ func (d *CSIDriver) ValidateControllerServiceRequest(c csi.ControllerServiceCapa
return nil return nil
} }
for _, capability := range d.cap { for _, capability := range d.capabilities {
if c == capability.GetRpc().GetType() { if c == capability.GetRpc().GetType() {
return nil return nil
} }
@ -91,7 +91,7 @@ func (d *CSIDriver) AddControllerServiceCapabilities(cl []csi.ControllerServiceC
csc = append(csc, NewControllerServiceCapability(c)) csc = append(csc, NewControllerServiceCapability(c))
} }
d.cap = csc d.capabilities = csc
} }
// AddVolumeCapabilityAccessModes stores volume access modes. // AddVolumeCapabilityAccessModes stores volume access modes.