-
Notifications
You must be signed in to change notification settings - Fork 293
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
Docker reports error on parsing crun version #77
Comments
What is the version of docker you are testing with? |
Built from tree in august, 12.
I know... have been using podman for a while too :) |
Must be something about the output that crun is generating that Docker does not like. |
It would be nice to get it working though, since F31 is going to cgroups v2 and runc is not be ready for it. So we are moving default to crun for the time being. |
That's great! This is the function on Docker that parses the runtime version: // parseRuncVersion parses the output of `runc --version` and extracts the
// "version" and "git commit" from the output.
//
// Output example from `runc --version`:
//
// runc version 1.0.0-rc5+dev
// commit: 69663f0bd4b60df09991c08812a60108003fa340
// spec: 1.0.0
func parseRuncVersion(v string) (version string, commit string, err error) {
lines := strings.Split(strings.TrimSpace(v), "\n")
for _, line := range lines {
if strings.HasPrefix(line, "runc version") {
version = strings.TrimSpace(strings.TrimPrefix(line, "runc version"))
continue
}
if strings.HasPrefix(line, "commit:") {
commit = strings.TrimSpace(strings.TrimPrefix(line, "commit:"))
continue
}
}
if version == "" && commit == "" {
err = errors.Errorf("unknown output format: %s", v)
}
return version, commit, err
} I think Docker shouldn't hardcore "runc version" on parsing. |
Could you fill an issue with Moby? We could easily work around it but I don't think there should be any assumption on the runtime version output if multiple runtime are supported, and should not be crun to lie about it. |
I will. Agree that it's not a thing to be fixed on crun side. |
Can you please tag me on the issue once you open it? |
Sure, one thing tho... I was looking at the code and is it possible to have something like "crun version 0.7" printed instead of "crun 0.7". This would ease parsing since it's the way runc does. |
That smells sloppy. I think we should not blindly copy what runc or other runtimes does. |
I think having version on the line would make it easier to patch. I would just split the line via spaces and take the last value. Why does Docker wants these values in the first place? Just for docker info? |
I think it’s the easier and faster option. I’ll submit a PR to address this. I believe it uses only for information. |
Opened moby/moby#39940. I think that with this, changing Crun won't be necessary. |
I also opened the PR #93 to address this on crun. |
Docker is reporting error on parsing crun version:
Docker is configured like this:
The text was updated successfully, but these errors were encountered: