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

status: added read from uuid-file#3860

Merged
iaguis merged 4 commits into
rkt:masterfrom
poonai:status
Nov 28, 2017
Merged

status: added read from uuid-file#3860
iaguis merged 4 commits into
rkt:masterfrom
poonai:status

Conversation

@poonai

@poonai poonai commented Nov 21, 2017

Copy link
Copy Markdown
Contributor

#3005 added --uuid-file to status command

@iaguis iaguis left a comment

Copy link
Copy Markdown
Member

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.

Comment thread rkt/status.go Outdated
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
Copy Markdown
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.

Comment thread rkt/status.go Outdated
}
var podUUID string

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

Copy link
Copy Markdown
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

lucab commented Nov 23, 2017

Copy link
Copy Markdown
Member

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

Comment thread rkt/status.go Outdated
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
Copy Markdown
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

poonai commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

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

@iaguis iaguis left a comment

Copy link
Copy Markdown
Member

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!

Comment thread rkt/status.go

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

Copy link
Copy Markdown
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.

exit 0
}

# Finds the branching point of two commits.

Copy link
Copy Markdown
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.

Comment thread tests/rkt_status_test.go Outdated
@@ -0,0 +1,49 @@
// Copyright 2016 The rkt Authors

Copy link
Copy Markdown
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 :)

Comment thread tests/rkt_status_test.go Outdated
ctx := testutils.NewRktRunCtx()
defer ctx.Cleanup()

//prepare

Copy link
Copy Markdown
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

poonai commented Nov 27, 2017

Copy link
Copy Markdown
Contributor Author

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

@iaguis

iaguis commented Nov 27, 2017

Copy link
Copy Markdown
Member

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

poonai commented Nov 28, 2017

Copy link
Copy Markdown
Contributor Author

@iaguis updated. 😄

@iaguis iaguis left a comment

Copy link
Copy Markdown
Member

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.

3 participants