-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add runtime-validate command to oci-runtime-tool #326
Conversation
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
func runtimeValidate(runtime string) error { | ||
fmt.Println("-----------------------------------------------------------------------------------") | ||
fmt.Printf(" VALIDATING RUNTIME: %q\n", runtime) | ||
fmt.Println("-----------------------------------------------------------------------------------") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this header is really necessary ;). Certainly not without a way to turn it off. But if removing it is part of post-PR polishing, then whatever, we can keep it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
} | ||
|
||
// Copy the runtimetest binary to the rootfs | ||
err = fileutils.CopyFile("runtimetest", filepath.Join(bundleDir, "/runtimetest")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't need/want the leading slash (that's what filepath.Join
is for).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
I'm not sure how much you intend to handle with this PR, but you may want a |
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
e7adbbb
to
3e07658
Compare
@wking Makefile already compiles oci-runtime-tool. This PR adds a new sub-command to it. |
On Fri, Feb 17, 2017 at 04:11:39PM -0800, Mrunal Patel wrote:
@wking Makefile already compiles oci-runtime-tool. This PR adds a
new sub-command to it.
Oh, right. Too much switching between the *-tools projects :p.
We could install the runtimetest, but given that it's a test binary,
I am not too excited about that option.
Yeah, me neither.
We could just make it an option to the command defaulting to looking
in the current working directory.
The compiled-in approach would be to use http.FileSystem or similar
(which would certainly be a lot easier here than in image-spec,
because all of that could be setup at build time without checking the
compiled fs.go into version control). I guess I like this approach
best if we're not comfortable installing runtimetest.
Short of that, an --runtimetest option (or whatever) with the same
semantics as your current --runtime option would work. Defaulting to
filepath.Join(".", "runtimetest") and dropping the value string inno
exec.LookPath would give you the path to copy (or an error which we
could die on). And while this would work, it's not a great user
experience to have to keep track of the location of an uninstalled
runtimetest.
|
Though --runtimetest option is not the best way, I think we can fix it later. I hope this can be landed as soon as possible. |
I agree with this. We can merge this and implement the remain 'TODO' later. |
This is a conversion of the script to golang. There are a couple of TODOs which will be implemented in follow on PRs.
The intent here is to move away from the script to go and then start building on top of that.