Skip to content

Commit cb1b94c

Browse files
authored
cmd: remove deployment shutdown --hide flag (#280)
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.
1 parent 194c7dc commit cb1b94c

File tree

4 files changed

+1
-8
lines changed

4 files changed

+1
-8
lines changed

cmd/deployment/shutdown.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@ var shutdownCmd = &cobra.Command{
4040
}
4141

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

4544
res, err := deployment.Shutdown(deployment.ShutdownParams{
4645
API: ecctl.Get().API,
4746
DeploymentID: args[0],
4847
SkipSnapshot: skipSnapshot,
49-
Hide: hide,
5048
})
5149
if err != nil {
5250
return err
@@ -67,5 +65,4 @@ func init() {
6765
Command.AddCommand(shutdownCmd)
6866
shutdownCmd.Flags().BoolP("track", "t", false, cmdutil.TrackFlagMessage)
6967
shutdownCmd.Flags().Bool("skip-snapshot", false, "Skips taking an Elasticsearch snapshot prior to shutting down the deployment")
70-
shutdownCmd.Flags().Bool("hide", false, "Hides the deployment and its resources after it has been shut down")
7168
}

docs/ecctl_deployment_shutdown.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ ecctl deployment shutdown <deployment-id> [flags]
1717

1818
----
1919
-h, --help help for shutdown
20-
--hide Hides the deployment and its resources after it has been shut down
2120
--skip-snapshot Skips taking an Elasticsearch snapshot prior to shutting down the deployment
2221
-t, --track Tracks the progress of the performed task
2322
----

docs/ecctl_deployment_shutdown.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ecctl deployment shutdown <deployment-id> [flags]
1414

1515
```
1616
-h, --help help for shutdown
17-
--hide Hides the deployment and its resources after it has been shut down
1817
--skip-snapshot Skips taking an Elasticsearch snapshot prior to shutting down the deployment
1918
-t, --track Tracks the progress of the performed task
2019
```

pkg/deployment/shutdown.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ type ShutdownParams struct {
3333
DeploymentID string
3434

3535
SkipSnapshot bool
36-
Hide bool
3736
}
3837

3938
// Validate ensures the parameters are usable by Shutdown.
@@ -61,8 +60,7 @@ func Shutdown(params ShutdownParams) (*models.DeploymentShutdownResponse, error)
6160
res, err := params.V1API.Deployments.ShutdownDeployment(
6261
deployments.NewShutdownDeploymentParams().
6362
WithDeploymentID(params.DeploymentID).
64-
WithSkipSnapshot(ec.Bool(params.SkipSnapshot)).
65-
WithHide(ec.Bool(params.Hide)),
63+
WithSkipSnapshot(ec.Bool(params.SkipSnapshot)),
6664
params.AuthWriter,
6765
)
6866
if err != nil {

0 commit comments

Comments
 (0)