Move ModifyConfig (and some related functions) into the clientcmd pkg.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
|
||||
"k8s.io/kubernetes/pkg/util/flag"
|
||||
)
|
||||
|
||||
@@ -35,7 +36,7 @@ const (
|
||||
)
|
||||
|
||||
type setOptions struct {
|
||||
configAccess ConfigAccess
|
||||
configAccess clientcmd.ConfigAccess
|
||||
propertyName string
|
||||
propertyValue string
|
||||
setRawBytes flag.Tristate
|
||||
@@ -45,7 +46,7 @@ const set_long = `Sets an individual value in a kubeconfig file
|
||||
PROPERTY_NAME is a dot delimited name where each token represents either a attribute name or a map key. Map keys may not contain dots.
|
||||
PROPERTY_VALUE is the new value you wish to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used.`
|
||||
|
||||
func NewCmdConfigSet(out io.Writer, configAccess ConfigAccess) *cobra.Command {
|
||||
func NewCmdConfigSet(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {
|
||||
options := &setOptions{configAccess: configAccess}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -96,7 +97,7 @@ func (o setOptions) run() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := ModifyConfig(o.configAccess, *config, false); err != nil {
|
||||
if err := clientcmd.ModifyConfig(o.configAccess, *config, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user