mirror of
https://github.com/beclab/Olares
synced 2026-05-23 08:48:25 +00:00
34 lines
803 B
Go
34 lines
803 B
Go
package pipelines
|
|
|
|
import (
|
|
"path"
|
|
|
|
"github.com/beclab/Olares/cli/cmd/ctl/options"
|
|
"github.com/beclab/Olares/cli/pkg/common"
|
|
"github.com/beclab/Olares/cli/pkg/core/logger"
|
|
"github.com/beclab/Olares/cli/pkg/phase/download"
|
|
)
|
|
|
|
func CheckDownloadInstallationPackage(opts *options.CliDownloadOptions) error {
|
|
arg := common.NewArgument()
|
|
arg.SetOlaresVersion(opts.Version)
|
|
arg.SetBaseDir(opts.BaseDir)
|
|
|
|
runtime, err := common.NewKubeRuntime(common.AllInOne, *arg)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
manifest := opts.Manifest
|
|
if manifest == "" {
|
|
manifest = path.Join(runtime.GetInstallerDir(), "installation.manifest")
|
|
}
|
|
|
|
p := download.NewCheckDownload(manifest, runtime)
|
|
if err := p.Start(); err != nil {
|
|
logger.Errorf("check download package failed %v", err)
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|