Skip to content

Commit

Permalink
fix:add check containerd (#4748)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostloda authored May 23, 2024
1 parent 0e1693c commit 18be6fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/checker/host_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func (a HostChecker) Check(cluster *v2.Cluster, _ string) error {
if err := checkHostnameUnique(execer, ipList); err != nil {
return err
}
if err := checkContainerd(execer, ipList); err != nil {
return err
}
return checkTimeSync(execer, ipList)
}

Expand Down Expand Up @@ -91,6 +94,18 @@ func checkTimeSync(s exec.Interface, ipList []string) error {
return nil
}

// Check whether the containerd is installed
func checkContainerd(s exec.Interface, ipList []string) error {
logger.Info("checker:containerd %v", ipList)
for _, ip := range ipList {
_, err := s.CmdToString(ip, "containerd --version", "")
if err == nil {
return fmt.Errorf("containerd is installed on %s please uninstall it first", ip)
}
}
return nil
}

func confirmNonOddMasters() error {
prompt := "Warning: Using an even number of master nodes is a risky operation and can lead to reduced high availability and potential resource wastage. " +
"It is strongly recommended to use an odd number of master nodes for optimal cluster stability. " +
Expand Down

0 comments on commit 18be6fe

Please sign in to comment.