From b8be5e134068ca99f642939c1aa677c4fde02e59 Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Mon, 11 Jan 2016 11:40:48 -0800 Subject: [PATCH] generate client for scale, which has only the expansion interface --- pkg/apis/extensions/types.go | 2 + .../unversioned/extensions_client.go | 5 +++ .../unversioned/generated_expansion.go | 2 + .../generated/extensions/unversioned/scale.go | 42 +++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 pkg/client/typed/generated/extensions/unversioned/scale.go diff --git a/pkg/apis/extensions/types.go b/pkg/apis/extensions/types.go index eff26b961d7..54bd36fd025 100644 --- a/pkg/apis/extensions/types.go +++ b/pkg/apis/extensions/types.go @@ -49,6 +49,8 @@ type ScaleStatus struct { Selector map[string]string `json:"selector,omitempty"` } +// +genclient=true,noMethods=true + // represents a scaling request for a resource. type Scale struct { unversioned.TypeMeta `json:",inline"` diff --git a/pkg/client/typed/generated/extensions/unversioned/extensions_client.go b/pkg/client/typed/generated/extensions/unversioned/extensions_client.go index cd939b802af..dcc42541bd6 100644 --- a/pkg/client/typed/generated/extensions/unversioned/extensions_client.go +++ b/pkg/client/typed/generated/extensions/unversioned/extensions_client.go @@ -28,6 +28,7 @@ type ExtensionsInterface interface { HorizontalPodAutoscalersGetter IngressesGetter JobsGetter + ScalesGetter ThirdPartyResourcesGetter } @@ -56,6 +57,10 @@ func (c *ExtensionsClient) Jobs(namespace string) JobInterface { return newJobs(c, namespace) } +func (c *ExtensionsClient) Scales(namespace string) ScaleInterface { + return newScales(c, namespace) +} + func (c *ExtensionsClient) ThirdPartyResources(namespace string) ThirdPartyResourceInterface { return newThirdPartyResources(c, namespace) } diff --git a/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go b/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go index 51c543d9f81..e256c5ce422 100644 --- a/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go +++ b/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go @@ -26,4 +26,6 @@ type IngressExpansion interface{} type JobExpansion interface{} +type ScaleExpansion interface{} + type ThirdPartyResourceExpansion interface{} diff --git a/pkg/client/typed/generated/extensions/unversioned/scale.go b/pkg/client/typed/generated/extensions/unversioned/scale.go new file mode 100644 index 00000000000..7e54bc34743 --- /dev/null +++ b/pkg/client/typed/generated/extensions/unversioned/scale.go @@ -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, + } +}