Merge pull request #33275 from maciaszczykm/remove-kubectl-namespace-cmd

Automatic merge from submit-queue

Remove kubectl namespace command

**What this PR does / why we need it**:

It removes deprecated `kubectl namespace` command, which `has been superseded by the context.namespace field of .kubeconfig files.  See 'kubectl config set-context --help' for more details`. It was done nearly two years ago, so like `// TODO remove once people have been given enough time to notice` comment says it may be a good time to get rid of it.

**Special notes for your reviewer**:

None ATM.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Remove kubectl namespace command
```
This commit is contained in:
Kubernetes Submit Queue
2016-09-24 02:51:39 -07:00
committed by GitHub
6 changed files with 0 additions and 92 deletions

View File

@@ -315,7 +315,6 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
filters := []string{
"options",
Deprecated("kubectl", "delete", cmds, NewCmdStop(f, out)),
Deprecated("kubectl", "config set-context", cmds, NewCmdNamespace(out)),
}
templates.ActsAsRootCommand(cmds, filters, groups...)

View File

@@ -1,41 +0,0 @@
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd
import (
"fmt"
"io"
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
)
// TODO remove once people have been given enough time to notice
func NewCmdNamespace(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "namespace [namespace]",
Short: "SUPERSEDED: Set and view the current Kubernetes namespace",
Long: `SUPERSEDED: Set and view the current Kubernetes namespace scope for command line requests.
namespace has been superseded by the context.namespace field of .kubeconfig files. See 'kubectl config set-context --help' for more details.
`,
Run: func(cmd *cobra.Command, args []string) {
util.CheckErr(fmt.Errorf("namespace has been superseded by the context.namespace field of .kubeconfig files. See 'kubectl config set-context --help' for more details."))
},
}
return cmd
}