Skip to content

Commit

Permalink
first round of fixes for test-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo authored and deads2k committed Dec 7, 2017
1 parent 9292a8c commit ee9ba1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pkg/oc/cli/cmd/set/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func (o *EnvOptions) RunEnv(f *clientcmd.Factory) error {

if len(o.From) != 0 {
b := f.NewBuilder().
Internal().
LocalParam(o.Local).
ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace().
Expand Down Expand Up @@ -290,6 +291,7 @@ func (o *EnvOptions) RunEnv(f *clientcmd.Factory) error {
}

b := f.NewBuilder().
Internal().
LocalParam(o.Local).
ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace().
Expand Down
2 changes: 2 additions & 0 deletions pkg/oc/experimental/config/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func NewCmdPatch(name, fullName string, f *clientcmd.Factory, out io.Writer) *co
cmd.Flags().StringVarP(&o.Patch, "patch", "p", "", "The patch to be applied to the resource JSON file.")
cmd.MarkFlagRequired("patch")
cmd.Flags().String("type", "strategic", fmt.Sprintf("The type of patch being provided; one of %v", sets.StringKeySet(patchTypes).List()))
cmdutil.AddPrinterFlags(cmd)

return cmd
}
Expand Down Expand Up @@ -134,6 +135,7 @@ func (o *PatchOptions) RunPatch() error {
}

r := o.Builder.
Internal().
FilenameParam(false, &resource.FilenameOptions{Recursive: false, Filenames: []string{o.Filename}}).
Flatten().
Do()
Expand Down
12 changes: 6 additions & 6 deletions tools/etcdhelper/etcdhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

jsonserializer "k8s.io/apimachinery/pkg/runtime/serializer/json"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/kubectl/scheme"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
Expand All @@ -24,7 +24,7 @@ import (
)

func init() {
apiregistration.Install(api.GroupFactoryRegistry, api.Registry, api.Scheme)
apiregistration.Install(scheme.GroupFactoryRegistry, scheme.Registry, scheme.Scheme)
}

func main() {
Expand Down Expand Up @@ -122,8 +122,8 @@ func getKey(client *clientv3.Client, key string) error {
return err
}

decoder := api.Codecs.UniversalDeserializer()
encoder := jsonserializer.NewSerializer(jsonserializer.DefaultMetaFactory, api.Scheme, api.Scheme, true)
decoder := scheme.Codecs.UniversalDeserializer()
encoder := jsonserializer.NewSerializer(jsonserializer.DefaultMetaFactory, scheme.Scheme, scheme.Scheme, true)

for _, kv := range resp.Kvs {
obj, gvk, err := decoder.Decode(kv.Value, nil, nil)
Expand All @@ -149,8 +149,8 @@ func dump(client *clientv3.Client) error {
}

kvData := []etcd3kv{}
decoder := api.Codecs.UniversalDeserializer()
encoder := jsonserializer.NewSerializer(jsonserializer.DefaultMetaFactory, api.Scheme, api.Scheme, false)
decoder := scheme.Codecs.UniversalDeserializer()
encoder := jsonserializer.NewSerializer(jsonserializer.DefaultMetaFactory, scheme.Scheme, scheme.Scheme, false)
objJSON := &bytes.Buffer{}

for _, kv := range response.Kvs {
Expand Down

0 comments on commit ee9ba1a

Please sign in to comment.