Skip to content

Commit 2326400

Browse files
authored
fix: remove the downloaded packages when install failed (#66)
* fix: remove the downloaded packages when install failed Signed-off-by: shilinlee <[email protected]>
1 parent 8bd60bc commit 2326400

File tree

8 files changed

+15
-425
lines changed

8 files changed

+15
-425
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
## Documentation
1111

12-
- [English](https://docs.opengemini.org/guide/reference/gemix/gemix_documentation_guide.html)
13-
- [简体中文](https://docs.opengemini.org/zh/guide/reference/gemix/gemix_documentation_guide)
12+
- [English]()
13+
- [简体中文](https://docs.opengemini.org/zh/guide/reference/gemix_manual.html)
1414

1515
## Installation
1616

@@ -32,6 +32,11 @@ gemix playground
3232
gemix cluster insall opengemini_demo v1.1.1 ./topology.yaml --skip-create-user -p
3333
```
3434

35+
Tips:
36+
37+
> If there are network issues with the automatic download of the installation package,
38+
> please place the installation package under `~/.gemix/storage/cluster/packages/`
39+
3540
## Usage
3641

3742
After installing `gemix`, you can use it to install binaries of openGemini components and create clusters.

pkg/cluster/operation/download.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ func Download(prefix, component, nodeOS, arch, version string) error {
4545

4646
if component == spec.ComponentGrafana {
4747
// FIXME: download from opengemini.org
48-
fileName = fmt.Sprintf("%s-%s.%s-%s.tar.gz", component, ver.GrafanaVersion, nodeOS, arch)
48+
if nodeOS == "darwin" {
49+
arch = "amd64"
50+
}
51+
fileName = fmt.Sprintf("%s-enterprise-%s.%s-%s.tar.gz", component, ver.GrafanaVersion, nodeOS, arch)
4952
componentUrl = strings.Join([]string{"https://dl.grafana.com/oss/release", fileName}, "/")
5053
}
5154
dstPath := spec.ProfilePath(spec.OpenGeminiPackageCacheDir, fileName)
@@ -55,9 +58,8 @@ func Download(prefix, component, nodeOS, arch, version string) error {
5558

5659
if utils2.IsExist(dstPath) {
5760
if component == spec.ComponentOpenGemini {
58-
if err := repository.VerifyComponent(version, dstPath); err != nil {
59-
_ = os.Remove(dstPath) // nolint
60-
}
61+
// TODO: do not remote package
62+
_ = repository.VerifyComponent(version, dstPath) // nolint
6163
}
6264
}
6365

pkg/repository/repo.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ func VerifyComponent(version, target string) error {
6161
checksums := spec.ProfilePath(spec.OpenGeminiPackageCacheDir, CHECKSUMS)
6262
if utils.IsNotExist(checksums) {
6363
if err := tryToDownloadCheckSumsFile(version); err != nil {
64-
return errors.WithStack(err)
64+
// FIXME: assume that the user downloaded the component without problems
65+
return nil
6566
}
6667
}
6768

util/clusterInfo.go

-91
This file was deleted.

util/connect.go

-144
This file was deleted.

0 commit comments

Comments
 (0)