Skip to content

Commit 3da4ace

Browse files
authored
fix: helm chart tgz download from minio (#2163)
Signed-off-by: 张启航 <[email protected]>
1 parent e1c320a commit 3da4ace

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

api/handler/helm.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
apimodel "github.com/goodrain/rainbond/api/model"
99
"github.com/goodrain/rainbond/api/util"
1010
"github.com/goodrain/rainbond/pkg/component/k8s"
11+
"github.com/goodrain/rainbond/pkg/component/storage"
1112
"github.com/goodrain/rainbond/pkg/generated/clientset/versioned"
1213
"github.com/goodrain/rainbond/pkg/helm"
1314
rutil "github.com/goodrain/rainbond/util"
@@ -180,6 +181,16 @@ func (h *HelmAction) GetUploadChartInformation(eventID string) ([]apimodel.HelmC
180181
if err != nil {
181182
return nil, err
182183
}
184+
if len(files) == 0 {
185+
err = storage.Default().StorageCli.DownloadDirToDir(basePath, basePath)
186+
if err != nil {
187+
return nil, err
188+
}
189+
files, err = filepath.Glob(path.Join(basePath, "*"))
190+
if err != nil {
191+
return nil, err
192+
}
193+
}
183194
if len(files) != 1 {
184195
return nil, fmt.Errorf("number of files is incorrect, make sure there is only one compressed package")
185196
}

0 commit comments

Comments
 (0)