Skip to content

Commit 3566c0d

Browse files
authored
imports: update cloud-sdk-go to v1.0.0-bc14 (#155)
Since the latest cloud-sdk-go version all cmdutil functions not specific to ecctl can now be found there. This PR updates the imports and deletes the files/functions which have been moved.
1 parent a471e32 commit 3566c0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+140
-1090
lines changed

cmd/auth/key/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"sync"
2323
"time"
2424

25+
"github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2526
multierror "github.com/hashicorp/go-multierror"
2627
"github.com/spf13/cobra"
2728

28-
cmdutil "github.com/elastic/ecctl/cmd/util"
2929
"github.com/elastic/ecctl/pkg/ecctl"
3030
userauth "github.com/elastic/ecctl/pkg/user/auth"
3131
)

cmd/deployment/apm/create.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package cmdapm
1919

2020
import (
2121
"github.com/elastic/cloud-sdk-go/pkg/models"
22+
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2223
"github.com/elastic/cloud-sdk-go/pkg/util/ec"
2324
"github.com/spf13/cobra"
2425

@@ -50,9 +51,9 @@ var createApmCmd = &cobra.Command{
5051
}
5152

5253
var payload *models.ApmPayload
53-
if err := cmdutil.FileOrStdin(cmd, "file"); err == nil {
54-
err := cmdutil.DecodeDefinition(cmd, "file", &payload)
55-
if err != nil && err != cmdutil.ErrNodefinitionLoaded {
54+
if err := sdkcmdutil.FileOrStdin(cmd, "file"); err == nil {
55+
err := sdkcmdutil.DecodeDefinition(cmd, "file", &payload)
56+
if err != nil && err != sdkcmdutil.ErrNodefinitionLoaded {
5657
return err
5758
}
5859
}

cmd/deployment/apm/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
package cmdapm
1919

2020
import (
21+
"github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2122
"github.com/spf13/cobra"
2223

23-
cmdutil "github.com/elastic/ecctl/cmd/util"
2424
"github.com/elastic/ecctl/pkg/deployment/apm"
2525
"github.com/elastic/ecctl/pkg/ecctl"
2626
"github.com/elastic/ecctl/pkg/util"

cmd/deployment/apm/plan/cancel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package cmdapmplan
2020
import (
2121
"fmt"
2222

23+
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2324
"github.com/spf13/cobra"
2425

2526
cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -31,7 +32,7 @@ import (
3132
var cancelPlanCmd = &cobra.Command{
3233
Use: "cancel <cluster id>",
3334
Short: "Cancels the pending plan",
34-
PreRunE: cmdutil.MinimumNArgsAndUUID(1),
35+
PreRunE: sdkcmdutil.MinimumNArgsAndUUID(1),
3536
RunE: func(cmd *cobra.Command, args []string) error {
3637
track, _ := cmd.Flags().GetBool("track")
3738
err := apm.CancelPlan(apm.PlanParams{

cmd/deployment/apm/plan/command.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
package cmdapmplan
1919

2020
import (
21+
"github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2122
"github.com/spf13/cobra"
22-
23-
cmdutil "github.com/elastic/ecctl/cmd/util"
2423
)
2524

2625
// Command represents the APM plan subcommand.

cmd/deployment/apm/plan/history.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"path/filepath"
2323

24+
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2425
"github.com/spf13/cobra"
2526

2627
cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -33,7 +34,7 @@ var listPlansCmd = &cobra.Command{
3334
Use: "history <cluster id>",
3435
Short: "Lists the plan history",
3536
Aliases: []string{"attempts"},
36-
PreRunE: cmdutil.MinimumNArgsAndUUID(1),
37+
PreRunE: sdkcmdutil.MinimumNArgsAndUUID(1),
3738
RunE: func(cmd *cobra.Command, args []string) error {
3839
track, _ := cmd.Flags().GetBool("track")
3940
p, err := apm.ListPlanHistory(apm.PlanParams{

cmd/deployment/apm/plan/monitor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"time"
2222

2323
"github.com/elastic/cloud-sdk-go/pkg/plan"
24+
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2425
"github.com/spf13/cobra"
2526

2627
cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -32,7 +33,7 @@ var monitorPlanCmd = &cobra.Command{
3233
Use: "monitor <cluster id>",
3334
Aliases: []string{"track"},
3435
Short: "Monitors the pending plan",
35-
PreRunE: cmdutil.MinimumNArgsAndUUID(1),
36+
PreRunE: sdkcmdutil.MinimumNArgsAndUUID(1),
3637
RunE: func(cmd *cobra.Command, args []string) error {
3738
return util.TrackCluster(util.TrackClusterParams{
3839
TrackParams: plan.TrackParams{

cmd/deployment/apm/plan/reapply.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package cmdapmplan
2020
import (
2121
"path/filepath"
2222

23+
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2324
"github.com/spf13/cobra"
2425

2526
cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -32,7 +33,7 @@ import (
3233
var reapplyLatestPlanCmd = &cobra.Command{
3334
Use: "reapply <cluster id>",
3435
Short: "Reapplies the latest plan attempt, resetting all transient settings",
35-
PreRunE: cmdutil.MinimumNArgsAndUUID(1),
36+
PreRunE: sdkcmdutil.MinimumNArgsAndUUID(1),
3637
RunE: func(cmd *cobra.Command, args []string) error {
3738
var reparams = &planutil.ReapplyParams{ID: args[0]}
3839
// Obtains the parameter's value and sets it in params

cmd/deployment/apm/restart.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package cmdapm
1919

2020
import (
21+
sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2122
"github.com/spf13/cobra"
2223

2324
cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -29,7 +30,7 @@ import (
2930
var restartApmCmd = &cobra.Command{
3031
Use: "restart",
3132
Short: "Restarts an APM deployment",
32-
PreRunE: cmdutil.MinimumNArgsAndUUID(1),
33+
PreRunE: sdkcmdutil.MinimumNArgsAndUUID(1),
3334
Aliases: []string{"start"},
3435
RunE: func(cmd *cobra.Command, args []string) error {
3536
track, _ := cmd.Flags().GetBool("track")

cmd/deployment/apm/resync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ package cmdapm
2020
import (
2121
"fmt"
2222

23+
"github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
2324
"github.com/spf13/cobra"
2425

25-
cmdutil "github.com/elastic/ecctl/cmd/util"
2626
"github.com/elastic/ecctl/pkg/deployment/apm"
2727
"github.com/elastic/ecctl/pkg/ecctl"
2828
)

0 commit comments

Comments
 (0)