From c770dd6432548b86b92bb51be98940456cf27529 Mon Sep 17 00:00:00 2001 From: David Gilson Date: Mon, 23 Oct 2023 14:01:56 +0200 Subject: [PATCH] #1129 fix getVersionAndSubVersion to use podman --- internal/controllers/requirements/docker/docker.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/controllers/requirements/docker/docker.go b/internal/controllers/requirements/docker/docker.go index c6e8645c0..f52a713e0 100644 --- a/internal/controllers/requirements/docker/docker.go +++ b/internal/controllers/requirements/docker/docker.go @@ -73,7 +73,7 @@ func validateIfDockerIsRunningInMinVersion(response string) error { logger.LogErrorWithLevel(messages.MsgErrorWhenDockerIsLowerVersion, ErrMinVersion) return err } - if version <= MinVersionDockerAccept && subversion < MinSubVersionDockerAccept { + if version <= MinVersionDockerAccept || subversion < MinSubVersionDockerAccept { fmt.Print("\n") logger.LogInfo(messages.MsgInfoDockerLowerVersion) fmt.Print("\n") @@ -83,11 +83,12 @@ func validateIfDockerIsRunningInMinVersion(response string) error { } func getVersionAndSubVersion(fullVersion string) (int, int, error) { - version, err := strconv.Atoi(fullVersion[0:2]) + splited := strings.Split(fullVersion, "."); + version, err := strconv.Atoi(splited[0]) if err != nil { return 0, 0, ErrDockerNotInstalled } - subversion, err := strconv.Atoi(strings.Split(fullVersion[3:5], ".")[0]) + subversion, err := strconv.Atoi(splited[1]) if err != nil { return 0, 0, ErrDockerNotInstalled }