Skip to content
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

alloc-status displays individual task state #424

Merged
merged 5 commits into from
Nov 17, 2015
Merged

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Nov 17, 2015

This PR updates nomad alloc-status to display task state in both a full and --short format. The --short only shows the current state and the last event, while the full display shows the recent set of events per task.

flags := c.Meta.FlagSet("alloc-status", FlagSetClient)
flags.Usage = func() { c.Ui.Output(c.Help()) }
flags.BoolVar(&short, "short", false, "")

if err := flags.Parse(args); err != nil {
return 1
}

// Check that we got exactly one allocation ID
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is wrong now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

output := make(chan string, len(m))
keys := make([]string, len(m))
i := 0
for k, _ := range m {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: When iterating over keys only you can omit the _ e.g.

for k := range m

@cbednarski
Copy link
Contributor

LGTM!

dadgar added a commit that referenced this pull request Nov 17, 2015
alloc-status displays individual task state
@dadgar dadgar merged commit aef7396 into master Nov 17, 2015
@dadgar dadgar deleted the f-alloc-status-cli branch November 17, 2015 02:49
benbuzbee pushed a commit to benbuzbee/nomad that referenced this pull request Jul 21, 2022
@github-actions
Copy link

github-actions bot commented May 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2023
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

2 participants