Skip to content

Commit

Permalink
ZupIT#1129 fix getVersionAndSubVersion to use podman
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilsonAfelio authored and gilsdav committed Oct 23, 2023
1 parent 873d410 commit a11f91c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/controllers/requirements/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
}
Expand Down

0 comments on commit a11f91c

Please sign in to comment.