Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

status: added read from uuid-file #3860

Merged
merged 4 commits into from
Nov 28, 2017
Merged

status: added read from uuid-file #3860

merged 4 commits into from
Nov 28, 2017

Conversation

poonai
Copy link
Contributor

@poonai poonai commented Nov 21, 2017

#3005 added --uuid-file to status command

Copy link
Member

@iaguis iaguis left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! A couple of comments.

rkt/status.go Outdated
@@ -30,7 +30,7 @@ import (

var (
cmdStatus = &cobra.Command{
Use: "status [--wait=bool|timeout] [--wait-ready=bool|timeout] UUID",
Use: "status [--wait=bool|timeout] [--wait-ready=bool|timeout] --uuid-file=FILE | UUID ...",
Copy link
Member

Choose a reason for hiding this comment

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

Why the ...? This seems to indicate you can input several UUIDs, but reading the code that's not the case.

rkt/status.go Outdated

if len(args) == 0 && flagUUIDFile != "" {
Copy link
Member

Choose a reason for hiding this comment

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

This logic allows users to type

# rkt status --uuid-file=/tmp/file 01abcde

And then it'll print the status of 01abcde.

This should not be allowed, if --uuid-file is present we should not accept other arguments, like we do for other commands like rkt stop.

@lucab
Copy link
Member

lucab commented Nov 23, 2017

Code looks fine to me. Do we maybe want to add functional test covering this?

rkt/status.go Outdated
@@ -30,7 +30,7 @@ import (

var (
cmdStatus = &cobra.Command{
Use: "status [--wait=bool|timeout] [--wait-ready=bool|timeout] UUID",
Use: "status [--wait=bool|timeout] [--wait-ready=bool|timeout] --uuid-file=FILE | UUID ",
Copy link
Member

Choose a reason for hiding this comment

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

Extra trailing space

@poonai
Copy link
Contributor Author

poonai commented Nov 25, 2017

I got busy with my examination so bit delayed with the pr. @iaguis I have made changes. @lucab I have added the test case, check and lemme know if any changes needed

Copy link
Member

@iaguis iaguis left a comment

Choose a reason for hiding this comment

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

Some small changes. Otherwise looks good!

@@ -30,7 +30,7 @@ import (

var (
cmdStatus = &cobra.Command{
Use: "status [--wait=bool|timeout] [--wait-ready=bool|timeout] UUID",
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing the trailing space! We try to keep commits to what they describe they're doing.

Can you please just remove it from the first commit? Right now it's added on the first commit just to be removed on the second one, that shouldn't be necessary if you don't add it in the first place.

@@ -28,9 +28,9 @@ function ciSkip {
exit 0
}

# Finds the branching point of two commits.
Copy link
Member

Choose a reason for hiding this comment

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

It's very nice you're fixing these trailing spaces. Can you make this a separate commit though? As I mentioned before, we try to keep commits focused to what they describe they're doing and this change is unrelated to tests.

@@ -0,0 +1,49 @@
// Copyright 2016 The rkt Authors
Copy link
Member

Choose a reason for hiding this comment

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

It's 2017 now :)

ctx := testutils.NewRktRunCtx()
defer ctx.Cleanup()

//prepare
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment is unnecessary.

@poonai
Copy link
Contributor Author

poonai commented Nov 27, 2017

@iaguis Thanks for reviewing. I have updated the PR. 👍

@iaguis
Copy link
Member

iaguis commented Nov 27, 2017

I'm fine with this PR now, only one last thing. Can you add the new flag to the documentation in Documentation/subcommands/status.md? Thanks!

@poonai
Copy link
Contributor Author

poonai commented Nov 28, 2017

@iaguis updated. 😄

Copy link
Member

@iaguis iaguis left a comment

Choose a reason for hiding this comment

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

lgtm

@iaguis iaguis merged commit dfa1722 into rkt:master Nov 28, 2017
@iaguis iaguis added this to the 1.30.0 milestone Apr 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants