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

New "maint" command #625

Merged
merged 15 commits into from
Jan 22, 2015
Merged

New "maint" command #625

merged 15 commits into from
Jan 22, 2015

Conversation

ryanuber
Copy link
Member

This introduces the consul maint command, which utilizes the new service/node maintenance mode API's to enable or disable maintenance mode from the CLI. This will make it easy to do something along the lines of

consul maint -enable; deploy.sh; consul maint -disable

As part of this, I've also added the reason argument and associated API query parameters. This allows passing a reason for entering maintenance mode. If none is provided, a default is used.

@@ -1039,12 +1039,17 @@ func (a *Agent) EnableServiceMaintenance(serviceID string) error {
return nil
}

// Use default notes if no reason provided
if reason == "" {
reason = "Maintenance mode is enabled for this service"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this a constant like DefaultReason? I also think we should have some text like "no reason provided" somewhere in there, maybe in parenthesis?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed on the constant. Also a recommendation to make this a bit more verbose and add verbiage such as: "No specific reason was provided. This is a default message."

@ryanuber
Copy link
Member Author

Added "list mode" to the consul maint command. Now if you don't provide one of -enable or -disable, consul maint will list out things that are under maintenance on the agent, and prints the provided reason for each.

@armon
Copy link
Member

armon commented Jan 22, 2015

LGTM! 🚢

armon added a commit that referenced this pull request Jan 22, 2015
@armon armon merged commit e1a5d53 into master Jan 22, 2015
@armon armon deleted the f-maintcmd branch January 22, 2015 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants