Skip to content

Commit 8225175

Browse files
authored
Add support for s3fs disable_noobj_cache flag (#269)
Add disable_noobj_cache as allowed arg to supported s3fs args Signed-off-by: Benjamin Isinger <[email protected]>
1 parent 7979b7b commit 8225175

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cos-csi-mounter/server/s3fs.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type S3FSArgs struct {
1717
CurlDebug string `json:"curldbg,omitempty"`
1818
DebugLevel string `json:"dbglevel,omitempty"`
1919
DefaultACL string `json:"default_acl,omitempty"`
20+
DisableNoobjCache string `json:"disable_noobj_cache,omitempty"`
2021
EndPoint string `json:"endpoint,omitempty"`
2122
GID string `json:"gid,omitempty"`
2223
IBMIamAuth string `json:"ibm_iam_auth,omitempty"`
@@ -124,6 +125,14 @@ func (args S3FSArgs) Validate(targetPath string) error {
124125
return fmt.Errorf("invalid value for 'curldbg' param. Should be either 'body' or 'normal': %v", args.CurlDebug)
125126
}
126127

128+
// Check if value of disable_noobj_cache is boolean "true" or "false"
129+
if args.DisableNoobjCache != "" {
130+
if isBool := isBoolString(args.DisableNoobjCache); !isBool {
131+
logger.Error("cannot convert value of disable_noobj_cache into boolean", zap.Any("disable_noobj_cache", args.DisableNoobjCache))
132+
return fmt.Errorf("cannot convert value of disable_noobj_cache into boolean: %v", args.DisableNoobjCache)
133+
}
134+
}
135+
127136
// Check if value of gid parameter can be converted to integer
128137
if args.GID != "" {
129138
_, err := strconv.Atoi(args.GID)

0 commit comments

Comments
 (0)