perf: support uploading .tar.gz format image package (#1852)

* perf: support uploading .tar.gz format image package

Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com>

* fix: change get version

Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com>

---------

Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com>
This commit is contained in:
张启航 2024-01-18 16:11:15 +08:00 committed by GitHub
parent 6627240878
commit e0596497e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ func (d *DockerRunOrImageParse) Parse() ParseErrorList {
tarPath := path.Join("/grdata/package_build/temp/events", eventID)
files, _ := filepath.Glob(path.Join(tarPath, "*"))
if len(files) == 1 {
if !strings.HasSuffix(files[0], ".tar") {
if !strings.HasSuffix(files[0], ".tar") && !strings.HasSuffix(files[0], ".tar.gz") {
d.errappend(ErrorAndSolve(FatalError, fmt.Sprintf("文件格式不正确"), SolveAdvice("modify_image", "请确认上传的文件格式是否正确")))
return d.errors
}

View File

@ -37,5 +37,5 @@ func ShowVersion(module string) {
// GetVersion GetVersion
func GetVersion() string {
return "test"
return version
}