Use versioned autoscaling API group in code-generator examples

This commit is contained in:
James Munnelly 2020-03-05 17:46:40 +00:00
parent 0ad60b35c1
commit 834331088f
15 changed files with 57 additions and 57 deletions

View File

@ -58,8 +58,8 @@ type ClusterTestTypeList struct {
// +genclient // +genclient
// +genclient:nonNamespaced // +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/autoscaling.Scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
type ClusterTestType struct { type ClusterTestType struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`

View File

@ -13,7 +13,7 @@ go_library(
importpath = "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1", importpath = "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",

View File

@ -22,13 +22,13 @@ import (
"context" "context"
"time" "time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1"
scheme "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/scheme" scheme "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/scheme"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. // ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface.
@ -48,8 +48,8 @@ type ClusterTestTypeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error)
GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscaling.Scale, error) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts metav1.UpdateOptions) (*autoscaling.Scale, error) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
ClusterTestTypeExpansion ClusterTestTypeExpansion
} }
@ -187,9 +187,9 @@ func (c *clusterTestTypes) Patch(ctx context.Context, name string, pt types.Patc
return return
} }
// GetScale takes name of the clusterTestType, and returns the corresponding autoscaling.Scale object, and an error if there is any. // GetScale takes name of the clusterTestType, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscaling.Scale, err error) { func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscaling.Scale{} result = &autoscalingv1.Scale{}
err = c.client.Get(). err = c.client.Get().
Resource("clustertesttypes"). Resource("clustertesttypes").
Name(clusterTestTypeName). Name(clusterTestTypeName).
@ -201,8 +201,8 @@ func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName str
} }
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts metav1.UpdateOptions) (result *autoscaling.Scale, err error) { func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscaling.Scale{} result = &autoscalingv1.Scale{}
err = c.client.Put(). err = c.client.Put().
Resource("clustertesttypes"). Resource("clustertesttypes").
Name(clusterTestTypeName). Name(clusterTestTypeName).

View File

@ -12,7 +12,7 @@ go_library(
importpath = "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake", importpath = "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",

View File

@ -21,6 +21,7 @@ package fake
import ( import (
"context" "context"
autoscalingv1 "k8s.io/api/autoscaling/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -28,7 +29,6 @@ import (
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
examplev1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" examplev1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// FakeClusterTestTypes implements ClusterTestTypeInterface // FakeClusterTestTypes implements ClusterTestTypeInterface
@ -134,21 +134,21 @@ func (c *FakeClusterTestTypes) Patch(ctx context.Context, name string, pt types.
} }
// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. // GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any.
func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscaling.Scale, err error) { func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscaling.Scale{}) Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscalingv1.Scale{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*autoscaling.Scale), err return obj.(*autoscalingv1.Scale), err
} }
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts v1.UpdateOptions) (result *autoscaling.Scale, err error) { func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscaling.Scale{}) Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscalingv1.Scale{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*autoscaling.Scale), err return obj.(*autoscalingv1.Scale), err
} }

View File

@ -58,8 +58,8 @@ type ClusterTestTypeList struct {
// +genclient // +genclient
// +genclient:nonNamespaced // +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/autoscaling.Scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
type ClusterTestType struct { type ClusterTestType struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`

View File

@ -13,7 +13,7 @@ go_library(
importpath = "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1", importpath = "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",

View File

@ -22,13 +22,13 @@ import (
"context" "context"
"time" "time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1"
scheme "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" scheme "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. // ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface.
@ -48,8 +48,8 @@ type ClusterTestTypeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error)
GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscaling.Scale, error) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts metav1.UpdateOptions) (*autoscaling.Scale, error) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
ClusterTestTypeExpansion ClusterTestTypeExpansion
} }
@ -187,9 +187,9 @@ func (c *clusterTestTypes) Patch(ctx context.Context, name string, pt types.Patc
return return
} }
// GetScale takes name of the clusterTestType, and returns the corresponding autoscaling.Scale object, and an error if there is any. // GetScale takes name of the clusterTestType, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscaling.Scale, err error) { func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscaling.Scale{} result = &autoscalingv1.Scale{}
err = c.client.Get(). err = c.client.Get().
Resource("clustertesttypes"). Resource("clustertesttypes").
Name(clusterTestTypeName). Name(clusterTestTypeName).
@ -201,8 +201,8 @@ func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName str
} }
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts metav1.UpdateOptions) (result *autoscaling.Scale, err error) { func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscaling.Scale{} result = &autoscalingv1.Scale{}
err = c.client.Put(). err = c.client.Put().
Resource("clustertesttypes"). Resource("clustertesttypes").
Name(clusterTestTypeName). Name(clusterTestTypeName).

View File

@ -12,7 +12,7 @@ go_library(
importpath = "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake", importpath = "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",

View File

@ -21,6 +21,7 @@ package fake
import ( import (
"context" "context"
autoscalingv1 "k8s.io/api/autoscaling/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -28,7 +29,6 @@ import (
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// FakeClusterTestTypes implements ClusterTestTypeInterface // FakeClusterTestTypes implements ClusterTestTypeInterface
@ -134,21 +134,21 @@ func (c *FakeClusterTestTypes) Patch(ctx context.Context, name string, pt types.
} }
// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. // GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any.
func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscaling.Scale, err error) { func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscaling.Scale{}) Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscalingv1.Scale{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*autoscaling.Scale), err return obj.(*autoscalingv1.Scale), err
} }
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts v1.UpdateOptions) (result *autoscaling.Scale, err error) { func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscaling.Scale{}) Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscalingv1.Scale{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*autoscaling.Scale), err return obj.(*autoscalingv1.Scale), err
} }

View File

@ -58,8 +58,8 @@ type ClusterTestTypeList struct {
// +genclient // +genclient
// +genclient:nonNamespaced // +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/autoscaling.Scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
type ClusterTestType struct { type ClusterTestType struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`

View File

@ -13,7 +13,7 @@ go_library(
importpath = "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1", importpath = "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",

View File

@ -22,13 +22,13 @@ import (
"context" "context"
"time" "time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" v1 "k8s.io/code-generator/_examples/crd/apis/example/v1"
scheme "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme" scheme "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. // ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface.
@ -48,8 +48,8 @@ type ClusterTestTypeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error)
GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscaling.Scale, error) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts metav1.UpdateOptions) (*autoscaling.Scale, error) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
ClusterTestTypeExpansion ClusterTestTypeExpansion
} }
@ -187,9 +187,9 @@ func (c *clusterTestTypes) Patch(ctx context.Context, name string, pt types.Patc
return return
} }
// GetScale takes name of the clusterTestType, and returns the corresponding autoscaling.Scale object, and an error if there is any. // GetScale takes name of the clusterTestType, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscaling.Scale, err error) { func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscaling.Scale{} result = &autoscalingv1.Scale{}
err = c.client.Get(). err = c.client.Get().
Resource("clustertesttypes"). Resource("clustertesttypes").
Name(clusterTestTypeName). Name(clusterTestTypeName).
@ -201,8 +201,8 @@ func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName str
} }
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts metav1.UpdateOptions) (result *autoscaling.Scale, err error) { func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscaling.Scale{} result = &autoscalingv1.Scale{}
err = c.client.Put(). err = c.client.Put().
Resource("clustertesttypes"). Resource("clustertesttypes").
Name(clusterTestTypeName). Name(clusterTestTypeName).

View File

@ -12,7 +12,7 @@ go_library(
importpath = "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake", importpath = "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",

View File

@ -21,6 +21,7 @@ package fake
import ( import (
"context" "context"
autoscalingv1 "k8s.io/api/autoscaling/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -28,7 +29,6 @@ import (
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// FakeClusterTestTypes implements ClusterTestTypeInterface // FakeClusterTestTypes implements ClusterTestTypeInterface
@ -134,21 +134,21 @@ func (c *FakeClusterTestTypes) Patch(ctx context.Context, name string, pt types.
} }
// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. // GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any.
func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscaling.Scale, err error) { func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscaling.Scale{}) Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscalingv1.Scale{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*autoscaling.Scale), err return obj.(*autoscalingv1.Scale), err
} }
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscaling.Scale, opts v1.UpdateOptions) (result *autoscaling.Scale, err error) { func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscaling.Scale{}) Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscalingv1.Scale{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*autoscaling.Scale), err return obj.(*autoscalingv1.Scale), err
} }