@@ -72,8 +72,8 @@ func (ns *GCENodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePub
72
72
return nil , err
73
73
}
74
74
if ! notMnt {
75
- // TODO: check if mount is compatible. Return OK if it is, or appropriate error.
76
- return nil , nil
75
+ // TODO(#95) : check if mount is compatible. Return OK if it is, or appropriate error.
76
+ return nil , status . Error ( codes . Unimplemented , "NodePublishVolume Mount point already exists, but cannot determine whether it is compatible or not" )
77
77
}
78
78
79
79
if err := ns .Mounter .Interface .MakeDir (targetPath ); err != nil {
@@ -92,27 +92,27 @@ func (ns *GCENodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePub
92
92
notMnt , mntErr := ns .Mounter .Interface .IsLikelyNotMountPoint (targetPath )
93
93
if mntErr != nil {
94
94
glog .Errorf ("IsLikelyNotMountPoint check failed: %v" , mntErr )
95
- return nil , status .Error (codes .Internal , fmt .Sprintf ("TODO : %v" , err ))
95
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("NodePublishVolume failed to check whether target path is a mount point : %v" , err ))
96
96
}
97
97
if ! notMnt {
98
98
if mntErr = ns .Mounter .Interface .Unmount (targetPath ); mntErr != nil {
99
99
glog .Errorf ("Failed to unmount: %v" , mntErr )
100
- return nil , status .Error (codes .Internal , fmt .Sprintf ("TODO : %v" , err ))
100
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("NodePublishVolume failed to unmount target path : %v" , err ))
101
101
}
102
102
notMnt , mntErr := ns .Mounter .Interface .IsLikelyNotMountPoint (targetPath )
103
103
if mntErr != nil {
104
104
glog .Errorf ("IsLikelyNotMountPoint check failed: %v" , mntErr )
105
- return nil , status .Error (codes .Internal , fmt .Sprintf ("TODO : %v" , err ))
105
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("NodePublishVolume failed to check whether target path is a mount point : %v" , err ))
106
106
}
107
107
if ! notMnt {
108
108
// This is very odd, we don't expect it. We'll try again next sync loop.
109
109
glog .Errorf ("%s is still mounted, despite call to unmount(). Will try again next sync loop." , targetPath )
110
- return nil , status .Error (codes .Internal , fmt .Sprintf ("TODO : %v" , err ))
110
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("NodePublishVolume something is wrong with mounting : %v" , err ))
111
111
}
112
112
}
113
113
os .Remove (targetPath )
114
114
glog .Errorf ("Mount of disk %s failed: %v" , targetPath , err )
115
- return nil , status .Error (codes .Internal , fmt .Sprintf ("TODO : %v" , err ))
115
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("NodePublishVolume mount of disk failed : %v" , err ))
116
116
}
117
117
118
118
glog .V (4 ).Infof ("Successfully mounted %s" , targetPath )
@@ -133,7 +133,7 @@ func (ns *GCENodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeU
133
133
return nil , status .Error (codes .InvalidArgument , "NodeUnpublishVolume Target Path must be provided" )
134
134
}
135
135
136
- // TODO: Check volume still exists
136
+ // TODO(#96) : Check volume still exists
137
137
138
138
err := ns .Mounter .Interface .Unmount (targetPath )
139
139
if err != nil {
@@ -167,10 +167,8 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
167
167
return nil , err
168
168
}
169
169
170
- // TODO: Check volume still exists?
171
-
172
170
// Part 1: Get device path of attached device
173
- // TODO: Get real partitions
171
+ // TODO(#83) : Get real partitions
174
172
partition := ""
175
173
176
174
devicePaths := ns .DeviceUtils .GetDiskByIdPaths (volumeKey .Name , partition )
@@ -199,9 +197,7 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
199
197
}
200
198
201
199
if ! notMnt {
202
- // TODO: Validate disk mode
203
-
204
- // TODO: Check who is mounted here. No error if its us
200
+ // TODO(#95): Check who is mounted here. No error if its us
205
201
return nil , fmt .Errorf ("already a mount point" )
206
202
207
203
}
@@ -215,11 +211,10 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
215
211
fstype = mnt .FsType
216
212
}
217
213
for _ , flag := range mnt .MountFlags {
218
- // TODO: Not sure if MountFlags == options
219
214
options = append (options , flag )
220
215
}
221
216
} else if blk := volumeCapability .GetBlock (); blk != nil {
222
- // TODO: Block volume support
217
+ // TODO(#64) : Block volume support
223
218
return nil , status .Error (codes .Unimplemented , fmt .Sprintf ("Block volume support is not yet implemented" ))
224
219
}
225
220
@@ -283,7 +278,7 @@ func (ns *GCENodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRe
283
278
284
279
resp := & csi.NodeGetInfoResponse {
285
280
NodeId : nodeID ,
286
- // TODO: Set MaxVolumesPerNode based on Node Type
281
+ // TODO(#19) : Set MaxVolumesPerNode based on Node Type
287
282
// Default of 0 means that CO Decides how many nodes can be published
288
283
// Can get from metadata server "machine-type"
289
284
MaxVolumesPerNode : 0 ,
0 commit comments