Skip to content

Commit

Permalink
cmd: remove deployment shutdown --hide flag (#280)
Browse files Browse the repository at this point in the history
This patch removes the --hide flag from the ecctl deployment shutdown command.

There was an issue where even if set to false, the API would return the following error if your user role was anything but "platform administrator": "Parameter [hide] is restricted and can only be set by a Platform administrator".

As the shut down deployments are now hidden by default anyway, there is no need for the --hide flag any more.
  • Loading branch information
karencfv committed May 7, 2020
1 parent 194c7dc commit cb1b94c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
3 changes: 0 additions & 3 deletions cmd/deployment/shutdown.go
Expand Up @@ -40,13 +40,11 @@ var shutdownCmd = &cobra.Command{
}

skipSnapshot, _ := cmd.Flags().GetBool("skip-snapshot")
hide, _ := cmd.Flags().GetBool("hide")

res, err := deployment.Shutdown(deployment.ShutdownParams{
API: ecctl.Get().API,
DeploymentID: args[0],
SkipSnapshot: skipSnapshot,
Hide: hide,
})
if err != nil {
return err
Expand All @@ -67,5 +65,4 @@ func init() {
Command.AddCommand(shutdownCmd)
shutdownCmd.Flags().BoolP("track", "t", false, cmdutil.TrackFlagMessage)
shutdownCmd.Flags().Bool("skip-snapshot", false, "Skips taking an Elasticsearch snapshot prior to shutting down the deployment")
shutdownCmd.Flags().Bool("hide", false, "Hides the deployment and its resources after it has been shut down")
}
1 change: 0 additions & 1 deletion docs/ecctl_deployment_shutdown.adoc
Expand Up @@ -17,7 +17,6 @@ ecctl deployment shutdown <deployment-id> [flags]

----
-h, --help help for shutdown
--hide Hides the deployment and its resources after it has been shut down
--skip-snapshot Skips taking an Elasticsearch snapshot prior to shutting down the deployment
-t, --track Tracks the progress of the performed task
----
Expand Down
1 change: 0 additions & 1 deletion docs/ecctl_deployment_shutdown.md
Expand Up @@ -14,7 +14,6 @@ ecctl deployment shutdown <deployment-id> [flags]

```
-h, --help help for shutdown
--hide Hides the deployment and its resources after it has been shut down
--skip-snapshot Skips taking an Elasticsearch snapshot prior to shutting down the deployment
-t, --track Tracks the progress of the performed task
```
Expand Down
4 changes: 1 addition & 3 deletions pkg/deployment/shutdown.go
Expand Up @@ -33,7 +33,6 @@ type ShutdownParams struct {
DeploymentID string

SkipSnapshot bool
Hide bool
}

// Validate ensures the parameters are usable by Shutdown.
Expand Down Expand Up @@ -61,8 +60,7 @@ func Shutdown(params ShutdownParams) (*models.DeploymentShutdownResponse, error)
res, err := params.V1API.Deployments.ShutdownDeployment(
deployments.NewShutdownDeploymentParams().
WithDeploymentID(params.DeploymentID).
WithSkipSnapshot(ec.Bool(params.SkipSnapshot)).
WithHide(ec.Bool(params.Hide)),
WithSkipSnapshot(ec.Bool(params.SkipSnapshot)),
params.AuthWriter,
)
if err != nil {
Expand Down

0 comments on commit cb1b94c

Please sign in to comment.