mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-01-19 07:52:52 +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
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
fmt "fmt"
|
||||
http "net/http"
|
||||
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
|
@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
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"
|
||||
)
|
||||
|
||||
@ -37,33 +37,33 @@ type FoosGetter interface {
|
||||
|
||||
// FooInterface has methods to work with Foo resources.
|
||||
type FooInterface interface {
|
||||
Create(ctx context.Context, foo *v1alpha1.Foo, opts v1.CreateOptions) (*v1alpha1.Foo, error)
|
||||
Update(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
||||
Create(ctx context.Context, foo *samplecontrollerv1alpha1.Foo, opts v1.CreateOptions) (*samplecontrollerv1alpha1.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().
|
||||
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
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Foo, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FooList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*samplecontrollerv1alpha1.Foo, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*samplecontrollerv1alpha1.FooList, 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
|
||||
}
|
||||
|
||||
// foos implements FooInterface
|
||||
type foos struct {
|
||||
*gentype.ClientWithList[*v1alpha1.Foo, *v1alpha1.FooList]
|
||||
*gentype.ClientWithList[*samplecontrollerv1alpha1.Foo, *samplecontrollerv1alpha1.FooList]
|
||||
}
|
||||
|
||||
// newFoos returns a Foos
|
||||
func newFoos(c *SamplecontrollerV1alpha1Client, namespace string) *foos {
|
||||
return &foos{
|
||||
gentype.NewClientWithList[*v1alpha1.Foo, *v1alpha1.FooList](
|
||||
gentype.NewClientWithList[*samplecontrollerv1alpha1.Foo, *samplecontrollerv1alpha1.FooList](
|
||||
"foos",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1alpha1.Foo { return &v1alpha1.Foo{} },
|
||||
func() *v1alpha1.FooList { return &v1alpha1.FooList{} }),
|
||||
func() *samplecontrollerv1alpha1.Foo { return &samplecontrollerv1alpha1.Foo{} },
|
||||
func() *samplecontrollerv1alpha1.FooList { return &samplecontrollerv1alpha1.FooList{} }),
|
||||
}
|
||||
}
|
||||
|
@ -19,11 +19,11 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||
"k8s.io/sample-controller/pkg/generated/clientset/versioned/scheme"
|
||||
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||
scheme "k8s.io/sample-controller/pkg/generated/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
type SamplecontrollerV1alpha1Interface interface {
|
||||
@ -85,7 +85,7 @@ func New(c rest.Interface) *SamplecontrollerV1alpha1Client {
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
gv := samplecontrollerv1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
fmt "fmt"
|
||||
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
|
@ -19,24 +19,24 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
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"
|
||||
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
|
||||
// Foos.
|
||||
type FooInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.FooLister
|
||||
Lister() samplecontrollerv1alpha1.FooLister
|
||||
}
|
||||
|
||||
type fooInformer struct {
|
||||
@ -71,7 +71,7 @@ func NewFilteredFooInformer(client versioned.Interface, namespace string, resync
|
||||
return client.SamplecontrollerV1alpha1().Foos(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&samplecontrollerv1alpha1.Foo{},
|
||||
&apissamplecontrollerv1alpha1.Foo{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@ -82,9 +82,9 @@ func (f *fooInformer) defaultInformer(client versioned.Interface, resyncPeriod t
|
||||
}
|
||||
|
||||
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 {
|
||||
return v1alpha1.NewFooLister(f.Informer().GetIndexer())
|
||||
func (f *fooInformer) Lister() samplecontrollerv1alpha1.FooLister {
|
||||
return samplecontrollerv1alpha1.NewFooLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/listers"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
v1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
listers "k8s.io/client-go/listers"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
|
||||
)
|
||||
|
||||
// FooLister helps list Foos.
|
||||
@ -30,7 +30,7 @@ import (
|
||||
type FooLister interface {
|
||||
// List lists all Foos in the indexer.
|
||||
// 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(namespace string) FooNamespaceLister
|
||||
FooListerExpansion
|
||||
@ -38,17 +38,17 @@ type FooLister interface {
|
||||
|
||||
// fooLister implements the FooLister interface.
|
||||
type fooLister struct {
|
||||
listers.ResourceIndexer[*v1alpha1.Foo]
|
||||
listers.ResourceIndexer[*samplecontrollerv1alpha1.Foo]
|
||||
}
|
||||
|
||||
// NewFooLister returns a new 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.
|
||||
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.
|
||||
@ -56,15 +56,15 @@ func (s *fooLister) Foos(namespace string) FooNamespaceLister {
|
||||
type FooNamespaceLister interface {
|
||||
// List lists all Foos in the indexer for a given namespace.
|
||||
// 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.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1alpha1.Foo, error)
|
||||
Get(name string) (*samplecontrollerv1alpha1.Foo, error)
|
||||
FooNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// fooNamespaceLister implements the FooNamespaceLister
|
||||
// interface.
|
||||
type fooNamespaceLister struct {
|
||||
listers.ResourceIndexer[*v1alpha1.Foo]
|
||||
listers.ResourceIndexer[*samplecontrollerv1alpha1.Foo]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user