Skip to content

Commit

Permalink
Merge pull request #609 from oldthreefeng/prefight_contianerd
Browse files Browse the repository at this point in the history
add prefight when version >= 1.20.
  • Loading branch information
fanux authored Mar 18, 2021
2 parents ed5732a + 2d69957 commit b29a700
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 b29a700

Please sign in to comment.