Update go dependencies

This commit is contained in:
Manuel de Brito Fontes 2017-04-01 11:42:02 -03:00
parent e0561ddeb9
commit 88a2751234
1970 changed files with 413928 additions and 222867 deletions

View file

@ -21,13 +21,13 @@ import (
"io/ioutil"
"os"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/api/v1"
)
// LoadPodFromFile will read, decode, and return a Pod from a file.
func LoadPodFromFile(filePath string) (*api.Pod, error) {
func LoadPodFromFile(filePath string) (*v1.Pod, error) {
if filePath == "" {
return nil, fmt.Errorf("file path not specified")
}
@ -38,9 +38,9 @@ func LoadPodFromFile(filePath string) (*api.Pod, error) {
if len(podDef) == 0 {
return nil, fmt.Errorf("file was empty: %s", filePath)
}
pod := &api.Pod{}
pod := &v1.Pod{}
codec := api.Codecs.LegacyCodec(registered.GroupOrDie(api.GroupName).GroupVersion)
codec := api.Codecs.LegacyCodec(api.Registry.GroupOrDie(v1.GroupName).GroupVersion)
if err := runtime.DecodeInto(codec, podDef, pod); err != nil {
return nil, fmt.Errorf("failed decoding file: %v", err)
}
@ -48,11 +48,11 @@ func LoadPodFromFile(filePath string) (*api.Pod, error) {
}
// SavePodToFile will encode and save a pod to a given path & permissions
func SavePodToFile(pod *api.Pod, filePath string, perm os.FileMode) error {
func SavePodToFile(pod *v1.Pod, filePath string, perm os.FileMode) error {
if filePath == "" {
return fmt.Errorf("file path not specified")
}
codec := api.Codecs.LegacyCodec(registered.GroupOrDie(api.GroupName).GroupVersion)
codec := api.Codecs.LegacyCodec(api.Registry.GroupOrDie(v1.GroupName).GroupVersion)
data, err := runtime.Encode(codec, pod)
if err != nil {
return fmt.Errorf("failed encoding pod: %v", err)