Skip to content

Commit

Permalink
fix: 修复批量导入文件时路径规则错误问题 (#3508)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambition9186 committed Sep 10, 2024
1 parent 06486ec commit 708803f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (c *configImport) ConfigFileImport(w http.ResponseWriter, r *http.Request)
Items: batch,
})
if errC != nil {
_ = render.Render(w, r, rest.BadRequest(errors.New(i18n.T(kt, "list config item failed, err: %v", err))))
_ = render.Render(w, r, rest.BadRequest(errors.New(i18n.T(kt, "list config item failed, err: %v", errC))))
return
}
for _, item := range tuple.GetDetails() {
Expand Down
2 changes: 1 addition & 1 deletion bcs-services/bcs-bscp/pkg/criteria/validator/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// validUnixFileSubPathRegexp sub path support character:
// 必须以 / 开头,且不能出现连续的 /
var validUnixFileSubPathRegexp = regexp.MustCompile(`^\/([^\/])+$`)
var validUnixFileSubPathRegexp = regexp.MustCompile(`^(/[^/]+)+/?$`)

// ValidateUnixFilePath validate unix os file path.
func ValidateUnixFilePath(kit *kit.Kit, path string) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@
"fuzzy": true
},
{
"id": "list config item failed, err: {Err}",
"message": "list config item failed, err: {Err}",
"translation": "list config item failed, err: {Err}",
"id": "list config item failed, err: {ErrC}",
"message": "list config item failed, err: {ErrC}",
"translation": "list config item failed, err: {ErrC}",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "Err",
"id": "ErrC",
"string": "%[1]v",
"type": "error",
"underlyingType": "interface{Error() string}",
"argNum": 1,
"expr": "err"
"expr": "errC"
}
],
"fuzzy": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@
]
},
{
"id": "list config item failed, err: {Err}",
"message": "list config item failed, err: {Err}",
"translation": "获取配置项失败, err: {Err}",
"id": "list config item failed, err: {ErrC}",
"message": "list config item failed, err: {ErrC}",
"translation": "获取配置项失败, err: {ErrC}",
"placeholders": [
{
"id": "Err",
"id": "ErrC",
"string": "%[1]v",
"type": "error",
"underlyingType": "interface{Error() string}",
"argNum": 1,
"expr": "err"
"expr": "errC"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@
]
},
{
"id": "list config item failed, err: {Err}",
"message": "list config item failed, err: {Err}",
"translation": "获取配置项失败, err: {Err}",
"id": "list config item failed, err: {ErrC}",
"message": "list config item failed, err: {ErrC}",
"translation": "获取配置项失败, err: {ErrC}",
"placeholders": [
{
"id": "Err",
"id": "ErrC",
"string": "%[1]v",
"type": "error",
"underlyingType": "interface{Error() string}",
"argNum": 1,
"expr": "err"
"expr": "errC"
}
]
},
Expand Down

0 comments on commit 708803f

Please sign in to comment.