client-go v4.0.0-beta0

go fmt

glide
This commit is contained in:
Murat Kabilov
2017-07-12 12:54:19 +02:00
parent 00150711e4
commit ce2648c62e
19 changed files with 207 additions and 280 deletions
+9 -8
View File
@@ -4,12 +4,13 @@ import (
"fmt"
"time"
apierrors "k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api"
apierrors "k8s.io/client-go/pkg/api/errors"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/runtime"
"k8s.io/client-go/pkg/runtime/serializer"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
@@ -38,21 +39,21 @@ func ResourceNotFound(err error) bool {
}
func KubernetesRestClient(c *rest.Config) (*rest.RESTClient, error) {
c.GroupVersion = &unversioned.GroupVersion{Version: constants.K8sVersion}
c.GroupVersion = &schema.GroupVersion{Version: constants.K8sVersion}
c.APIPath = constants.K8sAPIPath
c.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
schemeBuilder := runtime.NewSchemeBuilder(
func(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(
unversioned.GroupVersion{
schema.GroupVersion{
Group: constants.TPRVendor,
Version: constants.TPRApiVersion,
},
&spec.Postgresql{},
&spec.PostgresqlList{},
&api.ListOptions{},
&api.DeleteOptions{},
&meta_v1.ListOptions{},
&meta_v1.DeleteOptions{},
)
return nil
})
+2 -2
View File
@@ -8,7 +8,7 @@ import (
"time"
"github.com/motomux/pretty"
"k8s.io/client-go/pkg/api/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/zalando-incubator/postgres-operator/pkg/spec"
)
@@ -34,7 +34,7 @@ func RandomPassword(n int) string {
}
// NameFromMeta converts a metadata object to the NamespacedName name representation.
func NameFromMeta(meta v1.ObjectMeta) spec.NamespacedName {
func NameFromMeta(meta meta_v1.ObjectMeta) spec.NamespacedName {
return spec.NamespacedName{
Namespace: meta.Namespace,
Name: meta.Name,