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

cmd: add deployment resource start/start-maintenance commands #89

Merged
merged 5 commits into from
Dec 16, 2019

Conversation

karencfv
Copy link
Contributor

@karencfv karencfv commented Dec 12, 2019

Description

Adds the following command:

  • ecctl deployment resource start which starts a previously stopped deployment resource.
  • ecctl deployment resource start-maintenance which starts maintenance mode on a deployment resource.

Related Issue

#83

Motivation and Context

Implementing more of the deployment/resource APIs.

How Has This Been Tested?

Manually against an ece environment and by running unit test suite.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@karencfv karencfv requested a review from a team as a code owner December 12, 2019 20:57
@karencfv karencfv self-assigned this Dec 12, 2019
@karencfv karencfv added area:tooling enhancement New feature or request labels Dec 12, 2019
@karencfv karencfv changed the title cmd: add deployment resource start command cmd: add deployment resource start/start-maintenance commands Dec 12, 2019
marclop
marclop previously approved these changes Dec 13, 2019
Copy link
Collaborator

@marclop marclop left a comment

Choose a reason for hiding this comment

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

Looks good

cmd/deployment/resource/start-maintenance.go Show resolved Hide resolved

// Validate ensures the parameters are usable by Start.
func (params StartParams) Validate() error {
var merr = new(multierror.Error)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have a common structure right @marclop to avoid duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean depresource.NewStateless{} ? I don't think that struct works very well here, It has a bunch of fields that aren't relevant, and also the Validate() and fillDefaults() methods are different.

I can make a common struct for these commands and stop/stop-maintenance called StopStartParams if you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

No , no , I can't find a discussion I had with Marc last week on a GH pr about the same. @marclop can u help pls? :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

We discussed out of band that going forward probably a common structure with: API, DeploymentID, RefID, Type can be defined and used with all the validations in common. Including the fillDefaults ref-id auto-discovery.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so there will be another PR introducing the common struct with validation + filldefaults.
Great. we are good to go then

pkg/deployment/depresource/start.go Show resolved Hide resolved
Copy link
Collaborator

@marclop marclop left a comment

Choose a reason for hiding this comment

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

Awesome

@karencfv karencfv merged commit 706b480 into elastic:master Dec 16, 2019
@karencfv karencfv deleted the add-dep-resource-start-cmd branch December 16, 2019 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants