Skip to content

Commit

Permalink
add prefight when version >= 1.20.
Browse files Browse the repository at this point in the history
Signed-off-by: oldthreefeng <[email protected]>
  • Loading branch information
oldthreefeng committed Mar 16, 2021
1 parent ed5732a commit 2d69957
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions install/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (s *SealosInstaller) CheckValid() {
os.Exit(1)
}
dict := make(map[string]bool)
var errList []string
for _, h := range s.Hosts {
hostname := SSHConfig.CmdToString(h, "hostname", "") //获取主机名
if hostname == "" {
Expand All @@ -59,5 +60,24 @@ func (s *SealosInstaller) CheckValid() {
os.Exit(1)
}
}

// version >= 1.20 , Add prefight for containerd
if For120(Version) {
// for containerd. if docker exist ; exit frist.

dockerExist := SSHConfig.CmdToString(h, "command -v dockerd &> /dev/null && echo yes || :", "")
if dockerExist == "yes" {
errList = append(errList, h)
}
}
}

if len(errList) >= 1 {
logger.Error(`docker exist error when kubernetes version >= 1.20.
sealos install kubernetes version >= 1.20 use containerd cri instead.
please uninstall docker on [%s]. For example run on centos7: "yum remove docker-ce containerd-io -y",
see details: https://github.com/fanux/sealos/issues/582
`, errList)
os.Exit(-1)
}
}

0 comments on commit 2d69957

Please sign in to comment.