Skip to content

Commit

Permalink
debug kube file
Browse files Browse the repository at this point in the history
  • Loading branch information
shaowenchen committed Jul 22, 2024
1 parent 9ab7470 commit 9351125
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/option/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (f *FileOption) GetStorageType() string {
f.RemoteFile = remoteSplit[1]
} else {
f.StorageType = constants.RemoteStorageTypeImage
f.RuntimeImage = remoteSplit[0]
f.RemoteFile = remoteSplit[1]
}
return f.StorageType
Expand Down
8 changes: 5 additions & 3 deletions pkg/storage/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"regexp"
"strings"

"github.com/onsi/ginkgo/v2/internal/global"

Check failure on line 16 in pkg/storage/server.go

View workflow job for this annotation

GitHub Actions / GoReleaser

use of internal package github.com/onsi/ginkgo/v2/internal/global not allowed
"github.com/shaowenchen/ops/pkg/option"
"github.com/shaowenchen/ops/pkg/utils"
)
Expand Down Expand Up @@ -64,15 +65,16 @@ func ServerFile(fileOpt option.FileOption) (stdout string, err error) {
if err != nil {
return
}
targetFile := fileOpt.LocalFile
if fileOpt.AesKey != UnSetFlag && strings.HasSuffix(fileOpt.LocalFile, ".aes") {
tartgetFile := strings.TrimSuffix(fileOpt.LocalFile, ".aes")
err = DecryptFile(fileOpt.AesKey, fileOpt.LocalFile, tartgetFile)
targetFile = strings.TrimSuffix(fileOpt.LocalFile, ".aes")
err = DecryptFile(fileOpt.AesKey, fileOpt.LocalFile, targetFile)
defer os.Remove(fileOpt.LocalFile)
if err != nil {
return
}
}
stdout = fmt.Sprintf("Success download %s to %s", fileOpt.RemoteFile, fileOpt.LocalFile)
stdout = fmt.Sprintf("success download %s to %s", fileOpt.RemoteFile, targetFile)
} else {
stdout = fmt.Sprintf("Unknown direction: %s", fileOpt.Direction)
err = errors.New(stdout)
Expand Down

0 comments on commit 9351125

Please sign in to comment.