Update godeps

This commit is contained in:
Prashanth Balasubramanian 2016-06-21 11:58:43 -07:00
parent 423433bc5f
commit 701c5a0e30
482 changed files with 86915 additions and 19741 deletions

View file

@ -18,13 +18,16 @@ package unversioned
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/batch/v2alpha1"
"k8s.io/kubernetes/pkg/client/restclient"
)
type BatchInterface interface {
JobsNamespacer
ScheduledJobsNamespacer
}
// BatchClient is used to interact with Kubernetes batch features.
@ -36,9 +39,25 @@ func (c *BatchClient) Jobs(namespace string) JobInterface {
return newJobsV1(c, namespace)
}
func (c *BatchClient) ScheduledJobs(namespace string) ScheduledJobInterface {
return newScheduledJobs(c, namespace)
}
func NewBatch(c *restclient.Config) (*BatchClient, error) {
config := *c
if err := setBatchDefaults(&config); err != nil {
if err := setBatchDefaults(&config, nil); err != nil {
return nil, err
}
client, err := restclient.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &BatchClient{client}, nil
}
func NewBatchV2Alpha1(c *restclient.Config) (*BatchClient, error) {
config := *c
if err := setBatchDefaults(&config, &v2alpha1.SchemeGroupVersion); err != nil {
return nil, err
}
client, err := restclient.RESTClientFor(&config)
@ -49,14 +68,22 @@ func NewBatch(c *restclient.Config) (*BatchClient, error) {
}
func NewBatchOrDie(c *restclient.Config) *BatchClient {
client, err := NewBatch(c)
var (
client *BatchClient
err error
)
if c.ContentConfig.GroupVersion != nil && *c.ContentConfig.GroupVersion == v2alpha1.SchemeGroupVersion {
client, err = NewBatchV2Alpha1(c)
} else {
client, err = NewBatch(c)
}
if err != nil {
panic(err)
}
return client
}
func setBatchDefaults(config *restclient.Config) error {
func setBatchDefaults(config *restclient.Config, gv *unversioned.GroupVersion) error {
// if batch group is not registered, return an error
g, err := registered.Group(batch.GroupName)
if err != nil {
@ -69,6 +96,9 @@ func setBatchDefaults(config *restclient.Config) error {
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
if gv != nil {
copyGroupVersion = *gv
}
config.GroupVersion = &copyGroupVersion
//}