1- // Copyright 2025 NetApp, Inc. All Rights Reserved.
1+ // Copyright 2026 NetApp, Inc. All Rights Reserved.
22
33package csi
44
55import (
66 "context"
77 "fmt"
88 "math"
9- "net/http"
109 "reflect"
1110 "strconv"
1211 "strings"
@@ -34,20 +33,6 @@ import (
3433func (p * Plugin ) CreateVolume (
3534 ctx context.Context , req * csi.CreateVolumeRequest ,
3635) (res * csi.CreateVolumeResponse , err error ) {
37- ctx , rec := NewContextBuilder (ctx ).
38- WithWorkflow (WorkflowVolumeCreate ).
39- WithLayer (LogLayerCSIFrontend ).
40- WithSource (ContextSourceCSI ).
41- WithClient (ContextRequestClientCSIProvisioner ).
42- WithRoute (csi .Controller_CreateVolume_FullMethodName ).
43- WithMethod (http .MethodPost ).
44- WithTelemetry (
45- IncomingAPIRequestInFlightTelemeter ,
46- IncomingAPIRequestDurationTelemeter ,
47- ).
48- BuildContextAndTelemetry ()
49- defer rec (& err )
50-
5136 fields := LogFields {"Method" : "CreateVolume" , "Type" : "CSI_Controller" , "name" : req .Name }
5237 Logc (ctx ).WithFields (fields ).Debug (">>>> CreateVolume" )
5338 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< CreateVolume" )
@@ -316,20 +301,6 @@ func (p *Plugin) CreateVolume(
316301func (p * Plugin ) DeleteVolume (
317302 ctx context.Context , req * csi.DeleteVolumeRequest ,
318303) (res * csi.DeleteVolumeResponse , err error ) {
319- ctx , rec := NewContextBuilder (ctx ).
320- WithWorkflow (WorkflowVolumeDelete ).
321- WithLayer (LogLayerCSIFrontend ).
322- WithSource (ContextSourceCSI ).
323- WithClient (ContextRequestClientCSIProvisioner ).
324- WithRoute (csi .Controller_DeleteVolume_FullMethodName ).
325- WithMethod (http .MethodDelete ).
326- WithTelemetry (
327- IncomingAPIRequestInFlightTelemeter ,
328- IncomingAPIRequestDurationTelemeter ,
329- ).
330- BuildContextAndTelemetry ()
331- defer rec (& err )
332-
333304 fields := LogFields {"Method" : "DeleteVolume" , "Type" : "CSI_Controller" }
334305 Logc (ctx ).WithFields (fields ).Debug (">>>> DeleteVolume" )
335306 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< DeleteVolume" )
@@ -366,10 +337,7 @@ func stashIscsiTargetPortals(publishInfo map[string]string, volumePublishInfo *m
366337
367338func (p * Plugin ) ControllerPublishVolume (
368339 ctx context.Context , req * csi.ControllerPublishVolumeRequest ,
369- ) (* csi.ControllerPublishVolumeResponse , error ) {
370- ctx = SetContextWorkflow (ctx , WorkflowControllerPublish )
371- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
372-
340+ ) (res * csi.ControllerPublishVolumeResponse , err error ) {
373341 fields := LogFields {"Method" : "ControllerPublishVolume" , "Type" : "CSI_Controller" }
374342 Logc (ctx ).WithFields (fields ).Debug (">>>> ControllerPublishVolume" )
375343 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< ControllerPublishVolume" )
@@ -524,10 +492,7 @@ func populatePublishInfoFromCSIPublishRequest(info *models.VolumePublishInfo, re
524492
525493func (p * Plugin ) ControllerUnpublishVolume (
526494 ctx context.Context , req * csi.ControllerUnpublishVolumeRequest ,
527- ) (* csi.ControllerUnpublishVolumeResponse , error ) {
528- ctx = SetContextWorkflow (ctx , WorkflowControllerUnpublish )
529- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
530-
495+ ) (res * csi.ControllerUnpublishVolumeResponse , err error ) {
531496 fields := LogFields {"Method" : "ControllerUnpublishVolume" , "Type" : "CSI_Controller" }
532497 Logc (ctx ).WithFields (fields ).Debug (">>>> ControllerUnpublishVolume" )
533498 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< ControllerUnpublishVolume" )
@@ -581,10 +546,7 @@ func (p *Plugin) ControllerUnpublishVolume(
581546
582547func (p * Plugin ) ValidateVolumeCapabilities (
583548 ctx context.Context , req * csi.ValidateVolumeCapabilitiesRequest ,
584- ) (* csi.ValidateVolumeCapabilitiesResponse , error ) {
585- ctx = SetContextWorkflow (ctx , WorkflowVolumeGetCapabilities )
586- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
587-
549+ ) (res * csi.ValidateVolumeCapabilitiesResponse , err error ) {
588550 volumeID := req .GetVolumeId ()
589551 if volumeID == "" {
590552 return nil , status .Error (codes .InvalidArgument , "no volume ID provided" )
@@ -628,10 +590,7 @@ func (p *Plugin) ValidateVolumeCapabilities(
628590
629591func (p * Plugin ) ListVolumes (
630592 ctx context.Context , req * csi.ListVolumesRequest ,
631- ) (* csi.ListVolumesResponse , error ) {
632- ctx = SetContextWorkflow (ctx , WorkflowVolumeList )
633- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
634-
593+ ) (res * csi.ListVolumesResponse , err error ) {
635594 fields := LogFields {"Method" : "ListVolumes" , "Type" : "CSI_Controller" }
636595 Logc (ctx ).WithFields (fields ).Trace (">>>> ListVolumes" )
637596 defer Logc (ctx ).WithFields (fields ).Trace ("<<<< ListVolumes" )
@@ -710,10 +669,7 @@ func (p *Plugin) GetCapacity(_ context.Context, _ *csi.GetCapacityRequest) (*csi
710669
711670func (p * Plugin ) ControllerGetCapabilities (
712671 ctx context.Context , _ * csi.ControllerGetCapabilitiesRequest ,
713- ) (* csi.ControllerGetCapabilitiesResponse , error ) {
714- ctx = SetContextWorkflow (ctx , WorkflowControllerGetCapabilities )
715- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
716-
672+ ) (res * csi.ControllerGetCapabilitiesResponse , err error ) {
717673 fields := LogFields {"Method" : "ControllerGetCapabilities" , "Type" : "CSI_Controller" }
718674 Logc (ctx ).WithFields (fields ).Trace (">>>> ControllerGetCapabilities" )
719675 defer Logc (ctx ).WithFields (fields ).Trace ("<<<< ControllerGetCapabilities" )
@@ -723,10 +679,7 @@ func (p *Plugin) ControllerGetCapabilities(
723679
724680func (p * Plugin ) CreateSnapshot (
725681 ctx context.Context , req * csi.CreateSnapshotRequest ,
726- ) (* csi.CreateSnapshotResponse , error ) {
727- ctx = SetContextWorkflow (ctx , WorkflowSnapshotCreate )
728- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
729-
682+ ) (res * csi.CreateSnapshotResponse , err error ) {
730683 fields := LogFields {"Method" : "CreateSnapshot" , "Type" : "CSI_Controller" }
731684 Logc (ctx ).WithFields (fields ).Debug (">>>> CreateSnapshot" )
732685 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< CreateSnapshot" )
@@ -802,10 +755,7 @@ func (p *Plugin) CreateSnapshot(
802755
803756func (p * Plugin ) DeleteSnapshot (
804757 ctx context.Context , req * csi.DeleteSnapshotRequest ,
805- ) (* csi.DeleteSnapshotResponse , error ) {
806- ctx = SetContextWorkflow (ctx , WorkflowSnapshotDelete )
807- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
808-
758+ ) (res * csi.DeleteSnapshotResponse , err error ) {
809759 fields := LogFields {"Method" : "DeleteSnapshot" , "Type" : "CSI_Controller" }
810760 Logc (ctx ).WithFields (fields ).Debug (">>>> DeleteSnapshot" )
811761 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< DeleteSnapshot" )
@@ -842,10 +792,7 @@ func (p *Plugin) DeleteSnapshot(
842792
843793func (p * Plugin ) ListSnapshots (
844794 ctx context.Context , req * csi.ListSnapshotsRequest ,
845- ) (* csi.ListSnapshotsResponse , error ) {
846- ctx = SetContextWorkflow (ctx , WorkflowSnapshotList )
847- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
848-
795+ ) (res * csi.ListSnapshotsResponse , err error ) {
849796 fields := LogFields {"Method" : "ListSnapshots" , "Type" : "CSI_Controller" }
850797 Logc (ctx ).WithFields (fields ).Trace (">>>> ListSnapshots" )
851798 defer Logc (ctx ).WithFields (fields ).Trace ("<<<< ListSnapshots" )
@@ -973,10 +920,7 @@ func (p *Plugin) getListSnapshots(
973920
974921func (p * Plugin ) ControllerExpandVolume (
975922 ctx context.Context , req * csi.ControllerExpandVolumeRequest ,
976- ) (* csi.ControllerExpandVolumeResponse , error ) {
977- ctx = SetContextWorkflow (ctx , WorkflowVolumeResize )
978- ctx = GenerateRequestContextForLayer (ctx , LogLayerCSIFrontend )
979-
923+ ) (res * csi.ControllerExpandVolumeResponse , err error ) {
980924 fields := LogFields {"Method" : "ControllerExpandVolume" , "Type" : "CSI_Controller" }
981925 Logc (ctx ).WithFields (fields ).Debug (">>>> ControllerExpandVolume" )
982926 defer Logc (ctx ).WithFields (fields ).Debug ("<<<< ControllerExpandVolume" )
0 commit comments