Skip to content

Handle versions more broadly to account for the new Docker versioning scheme #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2017

Conversation

febbraro
Copy link
Member

@febbraro febbraro commented Mar 8, 2017

Previously, versions were only numbers (1.13.1) and not padded. Now, numbers are padded and with letters (17.03.0-ce).

Machine creation fails b/c it does not create the proper boot2docker URL so the ISO is not found.

output, _ := exec.Command("docker", "--version").Output()
re := regexp.MustCompile("Docker version ([\\d|\\.]+)")
versionNumber := re.FindAllStringSubmatch(string(output), -1)[0][1]
re := regexp.MustCompile("Docker version (.*),")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the previous regex used for validation? Seems we've removed all constraints from versioning. Maybe it should still exclude spaces?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format is "Docker version [theversionnumber], build [buildhash]" so feel comfortable (for now) grabbing everything before the space.

Copy link
Contributor

@grayside grayside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented on a regex but mostly because I never looked at it closely before.

@febbraro febbraro merged commit 4171a89 into develop Mar 8, 2017
@febbraro febbraro deleted the bug/docker-ce-version-fix branch March 8, 2017 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants