This commit is contained in:
admju
2024-09-10 17:01:54 +00:00
parent 75b7b94a50
commit 4bce096e1f
18 changed files with 315 additions and 75 deletions

View File

@@ -8,16 +8,16 @@ import (
"oc-deploy/helm"
)
type HelmInstallData struct {
type HelmInstall struct {
obj ToolData
tmp string
}
func (this HelmInstallData) Get() (ToolData) {
func (this HelmInstall) Get() (ToolData) {
return this.obj
}
func (this HelmInstallData) Download() (error) {
func (this HelmInstall) Download() (error) {
bin_dir := this.obj.Bin
err2 := os.MkdirAll(bin_dir, os.ModePerm)
@@ -35,7 +35,9 @@ func (this HelmInstallData) Download() (error) {
r, _ := os.Open(tmp_file)
err1 := utils.ExtractTarGz(bin_dir, r)
if err1 != nil {return err1}
if err1 != nil {
return err1
}
os.Remove(tmp_file)
@@ -48,7 +50,7 @@ func (this HelmInstallData) Download() (error) {
}
///////////////
func (this HelmInstallData) Version(path string) (string, error) {
func (this HelmInstall) Version(path string) (string, error) {
cmd := helm.HelmCommand{Bin: path}
cmd.New()
return cmd.GetVersion()