[Agent][GO] - fix docker deploy version
This commit is contained in:
@@ -200,13 +200,27 @@ func TestGzipFileNameToImageFullName(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageGzipFileNameToImageFullName_1(t *testing.T) {
|
||||
gzipFilePrefix := "/root/octopus_image/middle/"
|
||||
filepath.WalkDir(gzipFilePrefix, func(path string, d os.DirEntry, err error) error {
|
||||
//fmt.Println(path)
|
||||
name := d.Name()
|
||||
if strings.HasSuffix(name, ".tar.gz") {
|
||||
fullName := GzipFileNameToImageFullName(name)
|
||||
fmt.Println(fullName)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func TestImageGzipFileNameToImageFullName(t *testing.T) {
|
||||
|
||||
frontendMap := make(map[string]string)
|
||||
backendMap := make(map[string]string)
|
||||
srsMap := make(map[string]string)
|
||||
|
||||
gzipFilePrefix := "/root/octopus_image/xjyd/"
|
||||
gzipFilePrefix := "/root/octopus_image/middle/"
|
||||
filepath.WalkDir(gzipFilePrefix, func(path string, d os.DirEntry, err error) error {
|
||||
//fmt.Println(path)
|
||||
name := d.Name()
|
||||
|
||||
@@ -866,7 +866,7 @@ func (op *AgentOsOperator) installDockerExec(args []string) (bool, []string) {
|
||||
|
||||
// get by method
|
||||
ok, log4 := HardCodeCommandExecutor("apt-cache madison docker-ce | grep 20.10.20 | awk '{print$3}'")
|
||||
if ok {
|
||||
if ok && log4 != nil && len(log4) > 0 {
|
||||
specificDockerVersion = strings.TrimSpace(log4[0])
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ func TestHardCodeCommandExecutor(t *testing.T) {
|
||||
|
||||
// get by method
|
||||
ok, log4 := HardCodeCommandExecutor("apt-cache madison docker-ce | grep 20.10.20 | awk '{print$3}'")
|
||||
if ok {
|
||||
if ok && log4 != nil && len(log4) > 0 {
|
||||
specificDockerVersion = strings.TrimSpace(log4[0])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user