Skip to content

Commit 17e3d66

Browse files
generated: staging update
1 parent 3454a8d commit 17e3d66

File tree

244 files changed

+39860
-25141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+39860
-25141
lines changed

staging/src/k8s.io/client-go/Godeps/Godeps.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/flag.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_array.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_slice.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/discovery/discovery_client.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727

2828
"k8s.io/client-go/pkg/api"
2929
"k8s.io/client-go/pkg/api/errors"
30-
"k8s.io/client-go/pkg/api/unversioned"
3130
"k8s.io/client-go/pkg/api/v1"
31+
metav1 "k8s.io/client-go/pkg/apis/meta/v1"
3232
"k8s.io/client-go/pkg/runtime"
3333
"k8s.io/client-go/pkg/runtime/schema"
3434
"k8s.io/client-go/pkg/runtime/serializer"
@@ -59,15 +59,15 @@ type CachedDiscoveryInterface interface {
5959
type ServerGroupsInterface interface {
6060
// ServerGroups returns the supported groups, with information like supported versions and the
6161
// preferred version.
62-
ServerGroups() (*unversioned.APIGroupList, error)
62+
ServerGroups() (*metav1.APIGroupList, error)
6363
}
6464

6565
// ServerResourcesInterface has methods for obtaining supported resources on the API server
6666
type ServerResourcesInterface interface {
6767
// ServerResourcesForGroupVersion returns the supported resources for a group and version.
68-
ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error)
68+
ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
6969
// ServerResources returns the supported resources for all groups and versions.
70-
ServerResources() (map[string]*unversioned.APIResourceList, error)
70+
ServerResources() (map[string]*metav1.APIResourceList, error)
7171
// ServerPreferredResources returns the supported resources with the version preferred by the
7272
// server.
7373
ServerPreferredResources() ([]schema.GroupVersionResource, error)
@@ -96,12 +96,12 @@ type DiscoveryClient struct {
9696
LegacyPrefix string
9797
}
9898

99-
// Convert unversioned.APIVersions to unversioned.APIGroup. APIVersions is used by legacy v1, so
99+
// Convert metav1.APIVersions to metav1.APIGroup. APIVersions is used by legacy v1, so
100100
// group would be "".
101-
func apiVersionsToAPIGroup(apiVersions *unversioned.APIVersions) (apiGroup unversioned.APIGroup) {
102-
groupVersions := []unversioned.GroupVersionForDiscovery{}
101+
func apiVersionsToAPIGroup(apiVersions *metav1.APIVersions) (apiGroup metav1.APIGroup) {
102+
groupVersions := []metav1.GroupVersionForDiscovery{}
103103
for _, version := range apiVersions.Versions {
104-
groupVersion := unversioned.GroupVersionForDiscovery{
104+
groupVersion := metav1.GroupVersionForDiscovery{
105105
GroupVersion: version,
106106
Version: version,
107107
}
@@ -115,11 +115,11 @@ func apiVersionsToAPIGroup(apiVersions *unversioned.APIVersions) (apiGroup unver
115115

116116
// ServerGroups returns the supported groups, with information like supported versions and the
117117
// preferred version.
118-
func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList, err error) {
118+
func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err error) {
119119
// Get the groupVersions exposed at /api
120-
v := &unversioned.APIVersions{}
120+
v := &metav1.APIVersions{}
121121
err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
122-
apiGroup := unversioned.APIGroup{}
122+
apiGroup := metav1.APIGroup{}
123123
if err == nil {
124124
apiGroup = apiVersionsToAPIGroup(v)
125125
}
@@ -128,14 +128,14 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList
128128
}
129129

130130
// Get the groupVersions exposed at /apis
131-
apiGroupList = &unversioned.APIGroupList{}
131+
apiGroupList = &metav1.APIGroupList{}
132132
err = d.restClient.Get().AbsPath("/apis").Do().Into(apiGroupList)
133133
if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
134134
return nil, err
135135
}
136136
// to be compatible with a v1.0 server, if it's a 403 or 404, ignore and return whatever we got from /api
137137
if err != nil && (errors.IsNotFound(err) || errors.IsForbidden(err)) {
138-
apiGroupList = &unversioned.APIGroupList{}
138+
apiGroupList = &metav1.APIGroupList{}
139139
}
140140

141141
// append the group retrieved from /api to the list
@@ -144,7 +144,7 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList
144144
}
145145

146146
// ServerResourcesForGroupVersion returns the supported resources for a group and version.
147-
func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *unversioned.APIResourceList, err error) {
147+
func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *metav1.APIResourceList, err error) {
148148
url := url.URL{}
149149
if len(groupVersion) == 0 {
150150
return nil, fmt.Errorf("groupVersion shouldn't be empty")
@@ -154,7 +154,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r
154154
} else {
155155
url.Path = "/apis/" + groupVersion
156156
}
157-
resources = &unversioned.APIResourceList{}
157+
resources = &metav1.APIResourceList{}
158158
err = d.restClient.Get().AbsPath(url.String()).Do().Into(resources)
159159
if err != nil {
160160
// ignore 403 or 404 error to be compatible with an v1.0 server.
@@ -167,13 +167,13 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r
167167
}
168168

169169
// ServerResources returns the supported resources for all groups and versions.
170-
func (d *DiscoveryClient) ServerResources() (map[string]*unversioned.APIResourceList, error) {
170+
func (d *DiscoveryClient) ServerResources() (map[string]*metav1.APIResourceList, error) {
171171
apiGroups, err := d.ServerGroups()
172172
if err != nil {
173173
return nil, err
174174
}
175-
groupVersions := unversioned.ExtractGroupVersions(apiGroups)
176-
result := map[string]*unversioned.APIResourceList{}
175+
groupVersions := metav1.ExtractGroupVersions(apiGroups)
176+
result := map[string]*metav1.APIResourceList{}
177177
for _, groupVersion := range groupVersions {
178178
resources, err := d.ServerResourcesForGroupVersion(groupVersion)
179179
if err != nil {
@@ -305,7 +305,7 @@ func (d *DiscoveryClient) SwaggerSchema(version schema.GroupVersion) (*swagger.A
305305
if err != nil {
306306
return nil, err
307307
}
308-
groupVersions := unversioned.ExtractGroupVersions(groupList)
308+
groupVersions := metav1.ExtractGroupVersions(groupList)
309309
// This check also takes care the case that kubectl is newer than the running endpoint
310310
if stringDoesntExistIn(version.String(), groupVersions) {
311311
return nil, fmt.Errorf("API version: %v is not supported by the server. Use one of: %v", version, groupVersions)

0 commit comments

Comments
 (0)