filecli, filecmd: added uploading as helm chart

This commit is contained in:
2026-03-12 17:17:51 +02:00
parent 95ed9ddb97
commit 27c912d266
6 changed files with 170 additions and 20 deletions
+12 -1
View File
@@ -19,10 +19,16 @@ import (
"mstore/pkg/filecli"
)
const (
defMediaType = "application/octet-stream"
hcMediaType = "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
)
// PutFile
type PutFileParams struct {
Source string
Dest string
Chart bool
}
type PutFileResult struct{}
@@ -56,7 +62,12 @@ func (util *FileUtil) putFile(common *CommonFileParams, params *PutFileParams) (
mw := filecli.NewBasicAuthMiddleware(ref.Userinfo())
cli := filecli.NewClient(nil, mw)
err = cli.PutFile(ctx, ref.Raw(), file, stat.Size())
mime := defMediaType
if params.Chart {
mime = hcMediaType
}
err = cli.PutFile(ctx, ref.Raw(), mime, file, stat.Size())
if err != nil {
return res, err
}