mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-03-16 01:21:03 +08:00
generate
Kubernetes-commit: 2595aa13098355414a558b2d97c58d505ca7b6c2
This commit is contained in:
parent
7a10b052b6
commit
47cd9c2a21
@ -19,8 +19,8 @@ limitations under the License.
|
|||||||
package versioned
|
package versioned
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
fmt "fmt"
|
||||||
"net/http"
|
http "net/http"
|
||||||
|
|
||||||
discovery "k8s.io/client-go/discovery"
|
discovery "k8s.io/client-go/discovery"
|
||||||
rest "k8s.io/client-go/rest"
|
rest "k8s.io/client-go/rest"
|
||||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
package fake
|
package fake
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
context "context"
|
||||||
|
|
||||||
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"
|
||||||
|
@ -19,13 +19,13 @@ limitations under the License.
|
|||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
context "context"
|
||||||
|
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "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"
|
||||||
gentype "k8s.io/client-go/gentype"
|
gentype "k8s.io/client-go/gentype"
|
||||||
v1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||||
scheme "k8s.io/sample-controller/pkg/generated/clientset/versioned/scheme"
|
scheme "k8s.io/sample-controller/pkg/generated/clientset/versioned/scheme"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -37,33 +37,33 @@ type FoosGetter interface {
|
|||||||
|
|
||||||
// FooInterface has methods to work with Foo resources.
|
// FooInterface has methods to work with Foo resources.
|
||||||
type FooInterface interface {
|
type FooInterface interface {
|
||||||
Create(ctx context.Context, foo *v1alpha1.Foo, opts v1.CreateOptions) (*v1alpha1.Foo, error)
|
Create(ctx context.Context, foo *samplecontrollerv1alpha1.Foo, opts v1.CreateOptions) (*samplecontrollerv1alpha1.Foo, error)
|
||||||
Update(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
Update(ctx context.Context, foo *samplecontrollerv1alpha1.Foo, opts v1.UpdateOptions) (*samplecontrollerv1alpha1.Foo, error)
|
||||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||||
UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
UpdateStatus(ctx context.Context, foo *samplecontrollerv1alpha1.Foo, opts v1.UpdateOptions) (*samplecontrollerv1alpha1.Foo, error)
|
||||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Foo, error)
|
Get(ctx context.Context, name string, opts v1.GetOptions) (*samplecontrollerv1alpha1.Foo, error)
|
||||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FooList, error)
|
List(ctx context.Context, opts v1.ListOptions) (*samplecontrollerv1alpha1.FooList, error)
|
||||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Foo, err error)
|
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *samplecontrollerv1alpha1.Foo, err error)
|
||||||
FooExpansion
|
FooExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
// foos implements FooInterface
|
// foos implements FooInterface
|
||||||
type foos struct {
|
type foos struct {
|
||||||
*gentype.ClientWithList[*v1alpha1.Foo, *v1alpha1.FooList]
|
*gentype.ClientWithList[*samplecontrollerv1alpha1.Foo, *samplecontrollerv1alpha1.FooList]
|
||||||
}
|
}
|
||||||
|
|
||||||
// newFoos returns a Foos
|
// newFoos returns a Foos
|
||||||
func newFoos(c *SamplecontrollerV1alpha1Client, namespace string) *foos {
|
func newFoos(c *SamplecontrollerV1alpha1Client, namespace string) *foos {
|
||||||
return &foos{
|
return &foos{
|
||||||
gentype.NewClientWithList[*v1alpha1.Foo, *v1alpha1.FooList](
|
gentype.NewClientWithList[*samplecontrollerv1alpha1.Foo, *samplecontrollerv1alpha1.FooList](
|
||||||
"foos",
|
"foos",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
scheme.ParameterCodec,
|
scheme.ParameterCodec,
|
||||||
namespace,
|
namespace,
|
||||||
func() *v1alpha1.Foo { return &v1alpha1.Foo{} },
|
func() *samplecontrollerv1alpha1.Foo { return &samplecontrollerv1alpha1.Foo{} },
|
||||||
func() *v1alpha1.FooList { return &v1alpha1.FooList{} }),
|
func() *samplecontrollerv1alpha1.FooList { return &samplecontrollerv1alpha1.FooList{} }),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,11 @@ limitations under the License.
|
|||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
http "net/http"
|
||||||
|
|
||||||
rest "k8s.io/client-go/rest"
|
rest "k8s.io/client-go/rest"
|
||||||
v1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||||
"k8s.io/sample-controller/pkg/generated/clientset/versioned/scheme"
|
scheme "k8s.io/sample-controller/pkg/generated/clientset/versioned/scheme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SamplecontrollerV1alpha1Interface interface {
|
type SamplecontrollerV1alpha1Interface interface {
|
||||||
@ -85,7 +85,7 @@ func New(c rest.Interface) *SamplecontrollerV1alpha1Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setConfigDefaults(config *rest.Config) error {
|
func setConfigDefaults(config *rest.Config) error {
|
||||||
gv := v1alpha1.SchemeGroupVersion
|
gv := samplecontrollerv1alpha1.SchemeGroupVersion
|
||||||
config.GroupVersion = &gv
|
config.GroupVersion = &gv
|
||||||
config.APIPath = "/apis"
|
config.APIPath = "/apis"
|
||||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
package externalversions
|
package externalversions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
fmt "fmt"
|
||||||
|
|
||||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
cache "k8s.io/client-go/tools/cache"
|
cache "k8s.io/client-go/tools/cache"
|
||||||
|
@ -19,24 +19,24 @@ limitations under the License.
|
|||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
context "context"
|
||||||
time "time"
|
time "time"
|
||||||
|
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
watch "k8s.io/apimachinery/pkg/watch"
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
cache "k8s.io/client-go/tools/cache"
|
cache "k8s.io/client-go/tools/cache"
|
||||||
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
apissamplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||||
versioned "k8s.io/sample-controller/pkg/generated/clientset/versioned"
|
versioned "k8s.io/sample-controller/pkg/generated/clientset/versioned"
|
||||||
internalinterfaces "k8s.io/sample-controller/pkg/generated/informers/externalversions/internalinterfaces"
|
internalinterfaces "k8s.io/sample-controller/pkg/generated/informers/externalversions/internalinterfaces"
|
||||||
v1alpha1 "k8s.io/sample-controller/pkg/generated/listers/samplecontroller/v1alpha1"
|
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/generated/listers/samplecontroller/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FooInformer provides access to a shared informer and lister for
|
// FooInformer provides access to a shared informer and lister for
|
||||||
// Foos.
|
// Foos.
|
||||||
type FooInformer interface {
|
type FooInformer interface {
|
||||||
Informer() cache.SharedIndexInformer
|
Informer() cache.SharedIndexInformer
|
||||||
Lister() v1alpha1.FooLister
|
Lister() samplecontrollerv1alpha1.FooLister
|
||||||
}
|
}
|
||||||
|
|
||||||
type fooInformer struct {
|
type fooInformer struct {
|
||||||
@ -71,7 +71,7 @@ func NewFilteredFooInformer(client versioned.Interface, namespace string, resync
|
|||||||
return client.SamplecontrollerV1alpha1().Foos(namespace).Watch(context.TODO(), options)
|
return client.SamplecontrollerV1alpha1().Foos(namespace).Watch(context.TODO(), options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&samplecontrollerv1alpha1.Foo{},
|
&apissamplecontrollerv1alpha1.Foo{},
|
||||||
resyncPeriod,
|
resyncPeriod,
|
||||||
indexers,
|
indexers,
|
||||||
)
|
)
|
||||||
@ -82,9 +82,9 @@ func (f *fooInformer) defaultInformer(client versioned.Interface, resyncPeriod t
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *fooInformer) Informer() cache.SharedIndexInformer {
|
func (f *fooInformer) Informer() cache.SharedIndexInformer {
|
||||||
return f.factory.InformerFor(&samplecontrollerv1alpha1.Foo{}, f.defaultInformer)
|
return f.factory.InformerFor(&apissamplecontrollerv1alpha1.Foo{}, f.defaultInformer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fooInformer) Lister() v1alpha1.FooLister {
|
func (f *fooInformer) Lister() samplecontrollerv1alpha1.FooLister {
|
||||||
return v1alpha1.NewFooLister(f.Informer().GetIndexer())
|
return samplecontrollerv1alpha1.NewFooLister(f.Informer().GetIndexer())
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,10 @@ limitations under the License.
|
|||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
labels "k8s.io/apimachinery/pkg/labels"
|
||||||
"k8s.io/client-go/listers"
|
listers "k8s.io/client-go/listers"
|
||||||
"k8s.io/client-go/tools/cache"
|
cache "k8s.io/client-go/tools/cache"
|
||||||
v1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FooLister helps list Foos.
|
// FooLister helps list Foos.
|
||||||
@ -30,7 +30,7 @@ import (
|
|||||||
type FooLister interface {
|
type FooLister interface {
|
||||||
// List lists all Foos in the indexer.
|
// List lists all Foos in the indexer.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
List(selector labels.Selector) (ret []*v1alpha1.Foo, err error)
|
List(selector labels.Selector) (ret []*samplecontrollerv1alpha1.Foo, err error)
|
||||||
// Foos returns an object that can list and get Foos.
|
// Foos returns an object that can list and get Foos.
|
||||||
Foos(namespace string) FooNamespaceLister
|
Foos(namespace string) FooNamespaceLister
|
||||||
FooListerExpansion
|
FooListerExpansion
|
||||||
@ -38,17 +38,17 @@ type FooLister interface {
|
|||||||
|
|
||||||
// fooLister implements the FooLister interface.
|
// fooLister implements the FooLister interface.
|
||||||
type fooLister struct {
|
type fooLister struct {
|
||||||
listers.ResourceIndexer[*v1alpha1.Foo]
|
listers.ResourceIndexer[*samplecontrollerv1alpha1.Foo]
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFooLister returns a new FooLister.
|
// NewFooLister returns a new FooLister.
|
||||||
func NewFooLister(indexer cache.Indexer) FooLister {
|
func NewFooLister(indexer cache.Indexer) FooLister {
|
||||||
return &fooLister{listers.New[*v1alpha1.Foo](indexer, v1alpha1.Resource("foo"))}
|
return &fooLister{listers.New[*samplecontrollerv1alpha1.Foo](indexer, samplecontrollerv1alpha1.Resource("foo"))}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Foos returns an object that can list and get Foos.
|
// Foos returns an object that can list and get Foos.
|
||||||
func (s *fooLister) Foos(namespace string) FooNamespaceLister {
|
func (s *fooLister) Foos(namespace string) FooNamespaceLister {
|
||||||
return fooNamespaceLister{listers.NewNamespaced[*v1alpha1.Foo](s.ResourceIndexer, namespace)}
|
return fooNamespaceLister{listers.NewNamespaced[*samplecontrollerv1alpha1.Foo](s.ResourceIndexer, namespace)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FooNamespaceLister helps list and get Foos.
|
// FooNamespaceLister helps list and get Foos.
|
||||||
@ -56,15 +56,15 @@ func (s *fooLister) Foos(namespace string) FooNamespaceLister {
|
|||||||
type FooNamespaceLister interface {
|
type FooNamespaceLister interface {
|
||||||
// List lists all Foos in the indexer for a given namespace.
|
// List lists all Foos in the indexer for a given namespace.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
List(selector labels.Selector) (ret []*v1alpha1.Foo, err error)
|
List(selector labels.Selector) (ret []*samplecontrollerv1alpha1.Foo, err error)
|
||||||
// Get retrieves the Foo from the indexer for a given namespace and name.
|
// Get retrieves the Foo from the indexer for a given namespace and name.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
Get(name string) (*v1alpha1.Foo, error)
|
Get(name string) (*samplecontrollerv1alpha1.Foo, error)
|
||||||
FooNamespaceListerExpansion
|
FooNamespaceListerExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
// fooNamespaceLister implements the FooNamespaceLister
|
// fooNamespaceLister implements the FooNamespaceLister
|
||||||
// interface.
|
// interface.
|
||||||
type fooNamespaceLister struct {
|
type fooNamespaceLister struct {
|
||||||
listers.ResourceIndexer[*v1alpha1.Foo]
|
listers.ResourceIndexer[*samplecontrollerv1alpha1.Foo]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user