Skip to content

Commit 6d186b7

Browse files
committed
Address CR comments
Signed-off-by: Deep Debroy <[email protected]>
1 parent 45d3a58 commit 6d186b7

File tree

11 files changed

+347
-307
lines changed

11 files changed

+347
-307
lines changed

client/api/filesystem/v1alpha1/api.pb.go

Lines changed: 67 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/filesystem/v1alpha1/api.proto

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,24 @@ service Filesystem {
2020

2121
// Context of the paths used for path prefix validation
2222
enum PathContext {
23-
// Indicates the kubelet-csi-plugins-path parameter of csi-proxy be used as the path context
23+
// Indicates the kubelet-csi-plugins-path parameter of csi-proxy be used as
24+
// the path context. This may be used while handling NodeStageVolume where
25+
// a volume may need to be mounted at a plugin-specific path like:
26+
// kubelet\plugins\kubernetes.io\csi\pv\<pv-name>\globalmount
2427
PLUGIN = 0;
25-
// Indicates the kubelet-pod-path parameter of csi-proxy be used as the path context
26-
CONTAINER = 1;
28+
// Indicates the kubelet-pod-path parameter of csi-proxy be used as the path
29+
// context. This may be used while handling NodePublishVolume where a staged
30+
// volume may be need to be symlinked to a pod-specific path like:
31+
// kubelet\pods\<pod-uuid>\volumes\kubernetes.io~csi\<pvc-name>\mount
32+
POD = 1;
2733
}
2834

2935
message PathExistsRequest {
3036
// The path whose existence we want to check in the host's filesystem
3137
string path = 1;
3238

3339
// Context of the path parameter.
34-
// This is used to determine the root for relative path parameters
40+
// This is used to validate prefix for absolute paths passed
3541
PathContext context = 2;
3642
}
3743

@@ -53,24 +59,19 @@ message MkdirRequest {
5359
// User account under which csi-proxy is started (typically LocalSystem).
5460
//
5561
// Restrictions:
56-
// If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
57-
// depending on the context parameter of this function, the path prefix needs
62+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
63+
// Depending on the context parameter of this function, the path prefix needs
5864
// to match the paths specified either as kubelet-csi-plugins-path
5965
// or as kubelet-pod-path parameters of csi-proxy.
60-
// If a relative path is passed, depending on the context parameter of this
61-
// function, the path will be considered relative to the path specified either as
62-
// kubelet-csi-plugins-path or as kubelet-pod-path parameters of csi-proxy.
63-
// The path parameter cannot already exist on host filesystem.
66+
// The path parameter cannot already exist in the host's filesystem.
6467
// UNC paths of the form "\\server\share\path\file" are not allowed.
6568
// All directory separators need to be backslash character: "\".
6669
// Characters: .. / : | ? * in the path are not allowed.
6770
// Maximum path length will be capped to 260 characters.
6871
string path = 1;
6972

7073
// Context of the path parameter.
71-
// This is used to [1] determine the root for relative path parameters
72-
// or [2] validate prefix for absolute paths (indicated by a drive letter
73-
// prefix: e.g. "C:\")
74+
// This is used to validate prefix for absolute paths passed
7475
PathContext context = 2;
7576
}
7677

@@ -86,25 +87,23 @@ message RmdirRequest {
8687
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
8788
//
8889
// Restrictions:
89-
// If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
90-
// depending on the context parameter of this function, the path prefix needs
90+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
91+
// Depending on the context parameter of this function, the path prefix needs
9192
// to match the paths specified either as kubelet-csi-plugins-path
9293
// or as kubelet-pod-path parameters of csi-proxy.
93-
// If a relative path is passed, depending on the context parameter of this
94-
// function, the path will be considered relative to the path specified either as
95-
// kubelet-csi-plugins-path or as kubelet-pod-path parameters of csi-proxy.
9694
// UNC paths of the form "\\server\share\path\file" are not allowed.
9795
// All directory separators need to be backslash character: "\".
9896
// Characters: .. / : | ? * in the path are not allowed.
9997
// Path cannot be a file of type symlink.
10098
// Maximum path length will be capped to 260 characters.
10199
string path = 1;
102100

103-
// Context of the path creation used for path prefix validation
104-
// This is used to [1] determine the root for relative path parameters
105-
// or [2] validate prefix for absolute paths (indicated by a drive letter
106-
// prefix: e.g. "C:\")
101+
// Context of the path parameter.
102+
// This is used to validate prefix for absolute paths passed
107103
PathContext context = 2;
104+
105+
// Force remove all contents under path (if any).
106+
bool force = 3;
108107
}
109108

110109
message RmdirResponse {
@@ -119,11 +118,9 @@ message LinkPathRequest {
119118
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
120119
//
121120
// Restrictions:
122-
// If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
123-
// the path prefix needs to match the path specified as kubelet-csi-plugins-path
124-
// parameter of csi-proxy.
125-
// If a relative path is passed, the path will be considered relative to the
126-
// path specified as kubelet-csi-plugins-path parameter of csi-proxy.
121+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
122+
// The path prefix needs needs to match the paths specified as
123+
// kubelet-csi-plugins-path parameter of csi-proxy.
127124
// UNC paths of the form "\\server\share\path\file" are not allowed.
128125
// All directory separators need to be backslash character: "\".
129126
// Characters: .. / : | ? * in the path are not allowed.
@@ -137,11 +134,9 @@ message LinkPathRequest {
137134
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
138135
//
139136
// Restrictions:
140-
// If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
141-
// the path prefix needs to match the path specified as kubelet-pod-path
142-
// parameter of csi-proxy.
143-
// If a relative path is passed, the path will be considered relative to the
144-
// path specified as kubelet-pod-path parameter of csi-proxy.
137+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
138+
// The path prefix needs to match the paths specified as
139+
// kubelet-pod-path parameter of csi-proxy.
145140
// UNC paths of the form "\\server\share\path\file" are not allowed.
146141
// All directory separators need to be backslash character: "\".
147142
// Characters: .. / : | ? * in the path are not allowed.

0 commit comments

Comments
 (0)