From 3dec12a0e81b6eb4ed001fa8554e2a0763ff1917 Mon Sep 17 00:00:00 2001 From: Johnny Steenbergen Date: Thu, 9 Jul 2020 17:08:17 -0700 Subject: [PATCH] chore(pkger): drop deprecated influx pkg command tree --- CHANGELOG.md | 1 + cmd/influx/template.go | 48 +++--------------------------------------- 2 files changed, 4 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbacb797d5c..ba1164aa0c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [18888](https://github.com/influxdata/influxdb/pull/18888): Add event source to influx stack operations 1. [18910](https://github.com/influxdata/influxdb/pull/18910): Add uninstall functionality for stacks +1. [18912](https://github.com/influxdata/influxdb/pull/18912): Drop deprecated influx pkg command tree ### Bug Fixes diff --git a/cmd/influx/template.go b/cmd/influx/template.go index 7ff12e313c6..29c9341c99e 100644 --- a/cmd/influx/template.go +++ b/cmd/influx/template.go @@ -103,27 +103,8 @@ func newCmdPkgerBuilder(svcFn templateSVCsFn, f *globalFlags, opts genericCLIOpt } func (b *cmdTemplateBuilder) cmdApply() *cobra.Command { - cmd := b.cmdTemplateApply() - - deprecatedCmds := []*cobra.Command{ - b.cmdExport(), - b.cmdTemplateSummary(), - b.cmdStackDeprecated(), - b.cmdTemplateValidate(), - } - for i := range deprecatedCmds { - deprecatedCmds[i].Hidden = true - } - - cmd.AddCommand(deprecatedCmds...) - - return cmd -} - -func (b *cmdTemplateBuilder) cmdTemplateApply() *cobra.Command { cmd := b.newCmd("apply", b.applyRunEFn) enforceFlagValidation(cmd) - cmd.Aliases = []string{"pkg"} cmd.Short = "Apply a template to manage resources" cmd.Long = ` The apply command applies InfluxDB template(s). Use the command to create new @@ -572,19 +553,6 @@ func (b *cmdTemplateBuilder) exportStackRunEFn(cmd *cobra.Command, args []string } func (b *cmdTemplateBuilder) cmdTemplate() *cobra.Command { - cmd := b.newTemplateCmd("template") - cmd.Short = "Summarize the provided template" - cmd.AddCommand(b.cmdTemplateValidate()) - return cmd -} - -func (b *cmdTemplateBuilder) cmdTemplateSummary() *cobra.Command { - cmd := b.newTemplateCmd("summary") - cmd.Short = "Summarize the provided template" - return cmd -} - -func (b *cmdTemplateBuilder) newTemplateCmd(usage string) *cobra.Command { runE := func(cmd *cobra.Command, args []string) error { template, _, err := b.readTemplate() if err != nil { @@ -594,11 +562,13 @@ func (b *cmdTemplateBuilder) newTemplateCmd(usage string) *cobra.Command { return b.printTemplateSummary(0, template.Summary()) } - cmd := b.genericCLIOpts.newCmd(usage, runE, false) + cmd := b.genericCLIOpts.newCmd("template", runE, false) b.registerTemplateFileFlags(cmd) b.registerTemplatePrintOpts(cmd) + cmd.Short = "Summarize the provided template" + cmd.AddCommand(b.cmdTemplateValidate()) return cmd } @@ -654,18 +624,6 @@ func (b *cmdTemplateBuilder) cmdStacks() *cobra.Command { return cmd } -// TODO(jsteenb2): nuke the deprecated command here after OSS beta13 release. -func (b *cmdTemplateBuilder) cmdStackDeprecated() *cobra.Command { - cmd := b.genericCLIOpts.newCmd("stack", nil, false) - cmd.Short = "Stack management commands" - cmd.AddCommand( - b.cmdStackInit(), - b.cmdStackList(), - b.cmdStackRemove(), - ) - return cmd -} - func (b *cmdTemplateBuilder) cmdStackInit() *cobra.Command { cmd := b.newCmd("init", b.stackInitRunEFn) cmd.Short = "Initialize a stack"