generate client for scale, which has only the expansion interface

This commit is contained in:
Chao Xu 2016-01-11 11:40:48 -08:00
parent 00b18446ac
commit b8be5e1340
4 changed files with 51 additions and 0 deletions

View File

@ -49,6 +49,8 @@ type ScaleStatus struct {
Selector map[string]string `json:"selector,omitempty"` Selector map[string]string `json:"selector,omitempty"`
} }
// +genclient=true,noMethods=true
// represents a scaling request for a resource. // represents a scaling request for a resource.
type Scale struct { type Scale struct {
unversioned.TypeMeta `json:",inline"` unversioned.TypeMeta `json:",inline"`

View File

@ -28,6 +28,7 @@ type ExtensionsInterface interface {
HorizontalPodAutoscalersGetter HorizontalPodAutoscalersGetter
IngressesGetter IngressesGetter
JobsGetter JobsGetter
ScalesGetter
ThirdPartyResourcesGetter ThirdPartyResourcesGetter
} }
@ -56,6 +57,10 @@ func (c *ExtensionsClient) Jobs(namespace string) JobInterface {
return newJobs(c, namespace) return newJobs(c, namespace)
} }
func (c *ExtensionsClient) Scales(namespace string) ScaleInterface {
return newScales(c, namespace)
}
func (c *ExtensionsClient) ThirdPartyResources(namespace string) ThirdPartyResourceInterface { func (c *ExtensionsClient) ThirdPartyResources(namespace string) ThirdPartyResourceInterface {
return newThirdPartyResources(c, namespace) return newThirdPartyResources(c, namespace)
} }

View File

@ -26,4 +26,6 @@ type IngressExpansion interface{}
type JobExpansion interface{} type JobExpansion interface{}
type ScaleExpansion interface{}
type ThirdPartyResourceExpansion interface{} type ThirdPartyResourceExpansion interface{}

View File

@ -0,0 +1,42 @@
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package unversioned
// ScalesGetter has a method to return a ScaleInterface.
// A group's client should implement this interface.
type ScalesGetter interface {
Scales(namespace string) ScaleInterface
}
// ScaleInterface has methods to work with Scale resources.
type ScaleInterface interface {
ScaleExpansion
}
// scales implements ScaleInterface
type scales struct {
client *ExtensionsClient
ns string
}
// newScales returns a Scales
func newScales(c *ExtensionsClient, namespace string) *scales {
return &scales{
client: c,
ns: namespace,
}
}