Skip to content

Commit 032dcff

Browse files
Merge pull request #19915 from soltysh/hide_deprecated
Hide deprecated commands
2 parents 014d72a + f1845e7 commit 032dcff

File tree

7 files changed

+14
-7
lines changed

7 files changed

+14
-7
lines changed

pkg/oc/cli/cmd/buildlogs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ func NewCmdBuildLogs(fullName string, f *clientcmd.Factory, out io.Writer) *cobr
4141
Short: "Show logs from a build",
4242
Long: buildLogsLong,
4343
Example: fmt.Sprintf(buildLogsExample, fullName),
44-
Deprecated: fmt.Sprintf("use \"oc %v build/<build-name>\" instead.", LogsRecommendedCommandName),
44+
Deprecated: fmt.Sprintf("use oc %v build/<build-name>", LogsRecommendedCommandName),
45+
Hidden: true,
4546
Run: func(cmd *cobra.Command, args []string) {
4647
err := RunBuildLogs(fullName, f, out, cmd, opts, args)
4748

pkg/oc/cli/cmd/deploy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func NewCmdDeploy(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.C
108108
Long: fmt.Sprintf(deployLong, fullName),
109109
Example: fmt.Sprintf(deployExample, fullName),
110110
SuggestFor: []string{"deployment"},
111+
Deprecated: "use the oc rollout latest and oc rollout status",
112+
Hidden: true,
111113
Run: func(cmd *cobra.Command, args []string) {
112114
if err := options.Complete(f, args, out); err != nil {
113115
kcmdutil.CheckErr(err)
@@ -122,7 +124,6 @@ func NewCmdDeploy(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.C
122124
}
123125
},
124126
}
125-
cmd.Deprecated = "Use the `rollout latest` and `rollout cancel` commands instead."
126127

127128
cmd.Flags().BoolVar(&options.deployLatest, "latest", false, "If true, start a new deployment now.")
128129
cmd.Flags().MarkDeprecated("latest", fmt.Sprintf("use '%s rollout latest' instead", fullName))

pkg/oc/cli/cmd/export.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ func NewCmdExport(fullName string, f *clientcmd.Factory, in io.Reader, out io.Wr
5454
exporter := &DefaultExporter{}
5555
var filenames []string
5656
cmd := &cobra.Command{
57-
Use: "export RESOURCE/NAME ... [flags]",
58-
Short: "Export resources so they can be used elsewhere",
59-
Long: exportLong,
60-
Example: fmt.Sprintf(exportExample, fullName),
57+
Use: "export RESOURCE/NAME ... [flags]",
58+
Short: "Export resources so they can be used elsewhere",
59+
Long: exportLong,
60+
Example: fmt.Sprintf(exportExample, fullName),
61+
Deprecated: "use the oc get --export",
62+
Hidden: true,
6163
Run: func(cmd *cobra.Command, args []string) {
6264
err := RunExport(f, exporter, in, out, cmd, args, filenames)
6365
if err == kcmdutil.ErrExit {
@@ -66,7 +68,6 @@ func NewCmdExport(fullName string, f *clientcmd.Factory, in io.Reader, out io.Wr
6668
kcmdutil.CheckErr(err)
6769
},
6870
}
69-
cmd.Deprecated = "Use the `get --export` command instead."
7071

7172
cmd.Flags().String("as-template", "", "Output a Template object with specified name instead of a List or single object.")
7273
cmd.Flags().Bool("exact", false, "If true, preserve fields that may be cluster specific, such as service clusterIPs or generated names")

pkg/oc/cli/secrets/basicauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func NewCmdCreateBasicAuthSecret(name, fullName string, f kcmdutil.Factory, read
7070
Long: createBasicAuthSecretLong,
7171
Example: fmt.Sprintf(createBasicAuthSecretExample, fullName, newSecretFullName, ocEditFullName),
7272
Deprecated: "use oc create secret",
73+
Hidden: true,
7374
Run: func(c *cobra.Command, args []string) {
7475
if err := o.Complete(f, args); err != nil {
7576
kcmdutil.CheckErr(kcmdutil.UsageErrorf(c, err.Error()))

pkg/oc/cli/secrets/dockercfg.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func NewCmdCreateDockerConfigSecret(name, fullName string, f kcmdutil.Factory, o
7070
Long: createDockercfgLong,
7171
Example: fmt.Sprintf(createDockercfgExample, fullName, newSecretFullName, ocEditFullName),
7272
Deprecated: "use oc create secret",
73+
Hidden: true,
7374
Run: func(c *cobra.Command, args []string) {
7475
if err := o.Complete(f, args); err != nil {
7576
kcmdutil.CheckErr(kcmdutil.UsageErrorf(c, err.Error()))

pkg/oc/cli/secrets/new.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func NewCmdCreateSecret(name, fullName string, f *clientcmd.Factory, out io.Writ
8181
Long: newLong,
8282
Example: fmt.Sprintf(newExample, fullName),
8383
Deprecated: "use oc create secret",
84+
Hidden: true,
8485
Run: func(c *cobra.Command, args []string) {
8586
if err := options.Complete(args, f); err != nil {
8687
kcmdutil.CheckErr(kcmdutil.UsageErrorf(c, err.Error()))

pkg/oc/cli/secrets/sshauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func NewCmdCreateSSHAuthSecret(name, fullName string, f kcmdutil.Factory, out io
6464
Long: createSSHAuthSecretLong,
6565
Example: fmt.Sprintf(createSSHAuthSecretExample, fullName, newSecretFullName, ocEditFullName),
6666
Deprecated: "use oc create secret",
67+
Hidden: true,
6768
Run: func(c *cobra.Command, args []string) {
6869
if err := o.Complete(f, args); err != nil {
6970
kcmdutil.CheckErr(kcmdutil.UsageErrorf(c, err.Error()))

0 commit comments

Comments
 (0)