diff --git a/cmd/command/info/info.go b/cmd/command/info/info.go deleted file mode 100644 index f3b30926b..000000000 --- a/cmd/command/info/info.go +++ /dev/null @@ -1,40 +0,0 @@ -package info - -import ( - "fmt" - - "github.com/pluralsh/plural-cli/pkg/api" - "github.com/pluralsh/plural-cli/pkg/client" - "github.com/pluralsh/plural-cli/pkg/common" - "github.com/pluralsh/plural-cli/pkg/scaffold" - "github.com/urfave/cli" -) - -type Plural struct { - client.Plural -} - -func Command(clients client.Plural) cli.Command { - p := Plural{ - Plural: clients, - } - return cli.Command{ - Name: "info", - Usage: "Get information for your installation of APP", - ArgsUsage: "{app}", - Action: common.LatestVersion(common.RequireArgs(common.Owned(common.Rooted(p.info)), []string{"{app}"})), - } -} -func (p *Plural) info(c *cli.Context) error { - p.InitPluralClient() - repo := c.Args().Get(0) - installation, err := p.GetInstallation(repo) - if err != nil { - return api.GetErrorResponse(err, "GetInstallation") - } - if installation == nil { - return fmt.Errorf("You have not installed %s", repo) - } - - return scaffold.Notes(installation) -} diff --git a/cmd/command/plural/plural.go b/cmd/command/plural/plural.go index 6542b7b10..0673fb4ad 100644 --- a/cmd/command/plural/plural.go +++ b/cmd/command/plural/plural.go @@ -10,7 +10,6 @@ import ( "github.com/pluralsh/plural-cli/cmd/command/config" cryptocmd "github.com/pluralsh/plural-cli/cmd/command/crypto" "github.com/pluralsh/plural-cli/cmd/command/down" - "github.com/pluralsh/plural-cli/cmd/command/info" cmdinit "github.com/pluralsh/plural-cli/cmd/command/init" "github.com/pluralsh/plural-cli/cmd/command/log" "github.com/pluralsh/plural-cli/cmd/command/ops" @@ -18,7 +17,6 @@ import ( "github.com/pluralsh/plural-cli/cmd/command/profile" "github.com/pluralsh/plural-cli/cmd/command/proxy" "github.com/pluralsh/plural-cli/cmd/command/up" - "github.com/pluralsh/plural-cli/cmd/command/upgrade" "github.com/pluralsh/plural-cli/cmd/command/version" "github.com/pluralsh/plural-cli/cmd/command/vpn" "github.com/pluralsh/plural-cli/cmd/command/workspace" @@ -226,10 +224,8 @@ func CreateNewApp(plural *Plural) *cli.App { pr.Command(plural.Plural), proxy.Command(plural.Plural), log.Command(plural.Plural), - info.Command(plural.Plural), cmdinit.Command(plural.Plural), up.Command(plural.Plural), - upgrade.Command(plural.Plural), workspace.Command(plural.Plural, plural.HelmConfiguration), vpn.Command(plural.Plural), version.Command(), diff --git a/cmd/command/upgrade/upgrade.go b/cmd/command/upgrade/upgrade.go deleted file mode 100644 index 5ea5c7d5e..000000000 --- a/cmd/command/upgrade/upgrade.go +++ /dev/null @@ -1,61 +0,0 @@ -package upgrade - -import ( - "io" - "os" - - "github.com/pluralsh/plural-cli/pkg/client" - "github.com/pluralsh/plural-cli/pkg/common" - - "github.com/pluralsh/plural-cli/pkg/api" - "github.com/urfave/cli" -) - -type Plural struct { - client.Plural -} - -func Command(clients client.Plural) cli.Command { - p := Plural{ - Plural: clients, - } - return cli.Command{ - Name: "upgrade", - Usage: "creates an upgrade in the upgrade queue QUEUE for application REPO", - ArgsUsage: "{queue} {repo}", - Flags: []cli.Flag{ - cli.StringFlag{ - Name: "f", - Usage: "file containing upgrade contents, use - for stdin", - }, - }, - Action: common.LatestVersion(common.RequireArgs(p.handleUpgrade, []string{"{queue}", "{repo}"})), - } -} - -func (p *Plural) handleUpgrade(c *cli.Context) (err error) { - p.InitPluralClient() - queue, repo := c.Args().Get(0), c.Args().Get(1) - f := os.Stdin - fname := c.String("f") - if fname != "-" && fname != "" { - f, err = os.Open(fname) - if err != nil { - return - } - defer f.Close() - } - - contents, err := io.ReadAll(f) - if err != nil { - return - } - - attrs, err := api.ConstructUpgradeAttributes(contents) - if err != nil { - return - } - - err = p.CreateUpgrade(queue, repo, attrs) - return api.GetErrorResponse(err, "CreateUpgrade") -}