Merge pull request #25444 from janetkuo/kubectl-set

Automatic merge from submit-queue

Add 'kubectl set'

## Pull Request Guidelines

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
1. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
1. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.

```release-note
```

Ref #21648, the parent `kubectl set` command; will add more sub-command in subsequent PRs. @kubernetes/kubectl 


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
This commit is contained in:
k8s-merge-robot
2016-05-11 05:15:32 -07:00
10 changed files with 376 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import (
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
cmdconfig "k8s.io/kubernetes/pkg/kubectl/cmd/config"
"k8s.io/kubernetes/pkg/kubectl/cmd/rollout"
"k8s.io/kubernetes/pkg/kubectl/cmd/set"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/flag"
@@ -196,6 +197,7 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
cmds.SetGlobalNormalizationFunc(flag.WarnWordSepNormalizeFunc)
cmds.AddCommand(NewCmdGet(f, out))
cmds.AddCommand(set.NewCmdSet(f, out))
cmds.AddCommand(NewCmdDescribe(f, out))
cmds.AddCommand(NewCmdCreate(f, out))
cmds.AddCommand(NewCmdReplace(f, out))

View File

@@ -0,0 +1,48 @@
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 set
import (
"io"
"github.com/spf13/cobra"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
)
const (
set_long = `Configure application resources
These commands help you make changes to existing application resources.`
set_example = ``
)
func NewCmdSet(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "set SUBCOMMAND",
Short: "Set specific features on objects",
Long: set_long,
Example: set_example,
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
// TODO: add subcommands
return cmd
}