Skip to content

Commit 0cac632

Browse files
committed
feat(update): update inner tools
update inner tools Signed-off-by: ysicing <[email protected]>
1 parent fbd23ae commit 0cac632

File tree

6 files changed

+49
-5
lines changed

6 files changed

+49
-5
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.5
1+
1.3.6

common/vars.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type cloudAPIS struct {
2121
}
2222

2323
var (
24-
ValidPrefixes = []string{"qcadmin"}
24+
ValidPrefixes = []string{"qcadmin", "qc"}
2525
ValidDomainSuffix = []string{"haogs.cn", "corp.cc"}
2626
)
2727

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/docker/docker v20.10.21+incompatible
1313
github.com/easysoft/quikon-api v0.5.0
1414
github.com/emirpasic/gods v1.18.1
15-
github.com/ergoapi/util v0.2.24
15+
github.com/ergoapi/util v0.2.25
1616
github.com/gofrs/flock v0.8.1
1717
github.com/gosuri/uitable v0.0.4
1818
github.com/imroc/req/v3 v3.25.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m
245245
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
246246
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
247247
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
248-
github.com/ergoapi/util v0.2.24 h1:Tp16KGq4at6kn9r3xUPZ44JMyYbBSBMdyoyiYknQMkE=
249-
github.com/ergoapi/util v0.2.24/go.mod h1:lc2keKuxkzG0Uu3hTN8f/GECHTjjRse8mQ97RC6CaCc=
248+
github.com/ergoapi/util v0.2.25 h1:LF7KxGgqPKFep4tWM+MkrxShF0Dk9Xn34tjRhCy7h78=
249+
github.com/ergoapi/util v0.2.25/go.mod h1:lc2keKuxkzG0Uu3hTN8f/GECHTjjRse8mQ97RC6CaCc=
250250
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
251251
github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
252252
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=

hack/manifests/scripts/qc-dps

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
command_exists() {
4+
command -v "$@" > /dev/null 2>&1
5+
}
6+
7+
# 安装了docker
8+
if command_exists docker && [ -e /var/run/docker.sock ]; then
9+
(
10+
docker ps -a
11+
) || true
12+
elif command_exists crictl; then
13+
(
14+
defaultdir=$(cat .qc/config/cluster.yaml | grep datadir | awk '{print $2}')
15+
cfgdir=${defaultdir:-/opt/quickon}
16+
crictl --config ${cfgdir}/platform/agent/etc/crictl.yaml ps -a
17+
) || true
18+
fi

internal/static/stage.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
package static
88

99
import (
10+
"fmt"
11+
"strings"
12+
1013
"github.com/easysoft/qcadmin/common"
1114
"github.com/easysoft/qcadmin/internal/static/data"
1215
"github.com/easysoft/qcadmin/internal/static/deploy"
1316
"github.com/easysoft/qcadmin/internal/static/haogstls"
1417
"github.com/easysoft/qcadmin/internal/static/scripts"
18+
"github.com/ergoapi/util/file"
1519
)
1620

1721
func StageFiles() error {
@@ -28,5 +32,27 @@ func StageFiles() error {
2832
if err := haogstls.Stage(dataDir); err != nil {
2933
return err
3034
}
35+
if err := initInternalCommand(dataDir); err != nil {
36+
return err
37+
}
38+
return nil
39+
}
40+
41+
func initInternalCommand(dataDir string) error {
42+
// cp -a /root/.qc/data/hack/manifests/scripts/qc-* /root/.qc/bin/
43+
// cp -a /root/.qc/data/hack/manifests/scripts/qcadmin-* /root/.qc/bin/
44+
sourcePath := fmt.Sprintf("%s/hack/manifests/scripts", dataDir)
45+
files, err := file.DirFilesList(sourcePath, common.ValidPrefixes, nil)
46+
if err != nil {
47+
return err
48+
}
49+
for _, f := range files {
50+
s := strings.Split(f, "/")
51+
targetfile := fmt.Sprintf("%s/%s", common.GetDefaultBinDir(), s[len(s)-1])
52+
sourcefile := fmt.Sprintf("%s/%s", sourcePath, f)
53+
if err := file.Copy(sourcefile, targetfile, true); err != nil {
54+
return err
55+
}
56+
}
3157
return nil
3258
}

0 commit comments

Comments
 (0)