mirror of
https://github.com/rancher/types.git
synced 2025-07-15 22:15:49 +00:00
go generate
This commit is contained in:
parent
d381e58a9e
commit
7c47f85c08
1740
apis/management.cattle.io/v3/fakes/zz_generated_rke_addon_mock.go
Normal file
1740
apis/management.cattle.io/v3/fakes/zz_generated_rke_addon_mock.go
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4002,6 +4002,22 @@ func (in *IngressConfig) DeepCopy() *IngressConfig {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *K8sVersionInfo) DeepCopyInto(out *K8sVersionInfo) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K8sVersionInfo.
|
||||
func (in *K8sVersionInfo) DeepCopy() *K8sVersionInfo {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(K8sVersionInfo)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KafkaConfig) DeepCopyInto(out *KafkaConfig) {
|
||||
*out = *in
|
||||
@ -7591,6 +7607,66 @@ func (in *Question) DeepCopy() *Question {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEAddon) DeepCopyInto(out *RKEAddon) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEAddon.
|
||||
func (in *RKEAddon) DeepCopy() *RKEAddon {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEAddon)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEAddon) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEAddonList) DeepCopyInto(out *RKEAddonList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]RKEAddon, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEAddonList.
|
||||
func (in *RKEAddonList) DeepCopy() *RKEAddonList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEAddonList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEAddonList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEConfigNode) DeepCopyInto(out *RKEConfigNode) {
|
||||
*out = *in
|
||||
@ -7688,6 +7764,189 @@ func (in *RKEConfigServices) DeepCopy() *RKEConfigServices {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEK8sServiceOption) DeepCopyInto(out *RKEK8sServiceOption) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.ServiceOptions.DeepCopyInto(&out.ServiceOptions)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEK8sServiceOption.
|
||||
func (in *RKEK8sServiceOption) DeepCopy() *RKEK8sServiceOption {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEK8sServiceOption)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEK8sServiceOption) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEK8sServiceOptionList) DeepCopyInto(out *RKEK8sServiceOptionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]RKEK8sServiceOption, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEK8sServiceOptionList.
|
||||
func (in *RKEK8sServiceOptionList) DeepCopy() *RKEK8sServiceOptionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEK8sServiceOptionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEK8sServiceOptionList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEK8sSystemImage) DeepCopyInto(out *RKEK8sSystemImage) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.SystemImages = in.SystemImages
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEK8sSystemImage.
|
||||
func (in *RKEK8sSystemImage) DeepCopy() *RKEK8sSystemImage {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEK8sSystemImage)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEK8sSystemImage) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEK8sSystemImageList) DeepCopyInto(out *RKEK8sSystemImageList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]RKEK8sSystemImage, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEK8sSystemImageList.
|
||||
func (in *RKEK8sSystemImageList) DeepCopy() *RKEK8sSystemImageList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEK8sSystemImageList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEK8sSystemImageList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEK8sWindowsSystemImage) DeepCopyInto(out *RKEK8sWindowsSystemImage) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.SystemImages = in.SystemImages
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEK8sWindowsSystemImage.
|
||||
func (in *RKEK8sWindowsSystemImage) DeepCopy() *RKEK8sWindowsSystemImage {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEK8sWindowsSystemImage)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEK8sWindowsSystemImage) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEK8sWindowsSystemImageList) DeepCopyInto(out *RKEK8sWindowsSystemImageList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]RKEK8sWindowsSystemImage, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEK8sWindowsSystemImageList.
|
||||
func (in *RKEK8sWindowsSystemImageList) DeepCopy() *RKEK8sWindowsSystemImageList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RKEK8sWindowsSystemImageList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RKEK8sWindowsSystemImageList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RKEPlan) DeepCopyInto(out *RKEPlan) {
|
||||
*out = *in
|
||||
|
@ -79,6 +79,10 @@ type Interface interface {
|
||||
CloudCredentialsGetter
|
||||
ClusterTemplatesGetter
|
||||
ClusterTemplateRevisionsGetter
|
||||
RKEK8sSystemImagesGetter
|
||||
RKEK8sServiceOptionsGetter
|
||||
RKEAddonsGetter
|
||||
RKEK8sWindowsSystemImagesGetter
|
||||
}
|
||||
|
||||
type Clients struct {
|
||||
@ -143,6 +147,10 @@ type Clients struct {
|
||||
CloudCredential CloudCredentialClient
|
||||
ClusterTemplate ClusterTemplateClient
|
||||
ClusterTemplateRevision ClusterTemplateRevisionClient
|
||||
RKEK8sSystemImage RKEK8sSystemImageClient
|
||||
RKEK8sServiceOption RKEK8sServiceOptionClient
|
||||
RKEAddon RKEAddonClient
|
||||
RKEK8sWindowsSystemImage RKEK8sWindowsSystemImageClient
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
@ -209,6 +217,10 @@ type Client struct {
|
||||
cloudCredentialControllers map[string]CloudCredentialController
|
||||
clusterTemplateControllers map[string]ClusterTemplateController
|
||||
clusterTemplateRevisionControllers map[string]ClusterTemplateRevisionController
|
||||
rkeK8sSystemImageControllers map[string]RKEK8sSystemImageController
|
||||
rkeK8sServiceOptionControllers map[string]RKEK8sServiceOptionController
|
||||
rkeAddonControllers map[string]RKEAddonController
|
||||
rkeK8sWindowsSystemImageControllers map[string]RKEK8sWindowsSystemImageController
|
||||
}
|
||||
|
||||
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
|
||||
@ -421,6 +433,18 @@ func NewClientsFromInterface(iface Interface) *Clients {
|
||||
ClusterTemplateRevision: &clusterTemplateRevisionClient2{
|
||||
iface: iface.ClusterTemplateRevisions(""),
|
||||
},
|
||||
RKEK8sSystemImage: &rkeK8sSystemImageClient2{
|
||||
iface: iface.RKEK8sSystemImages(""),
|
||||
},
|
||||
RKEK8sServiceOption: &rkeK8sServiceOptionClient2{
|
||||
iface: iface.RKEK8sServiceOptions(""),
|
||||
},
|
||||
RKEAddon: &rkeAddonClient2{
|
||||
iface: iface.RKEAddons(""),
|
||||
},
|
||||
RKEK8sWindowsSystemImage: &rkeK8sWindowsSystemImageClient2{
|
||||
iface: iface.RKEK8sWindowsSystemImages(""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -496,6 +520,10 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
cloudCredentialControllers: map[string]CloudCredentialController{},
|
||||
clusterTemplateControllers: map[string]ClusterTemplateController{},
|
||||
clusterTemplateRevisionControllers: map[string]ClusterTemplateRevisionController{},
|
||||
rkeK8sSystemImageControllers: map[string]RKEK8sSystemImageController{},
|
||||
rkeK8sServiceOptionControllers: map[string]RKEK8sServiceOptionController{},
|
||||
rkeAddonControllers: map[string]RKEAddonController{},
|
||||
rkeK8sWindowsSystemImageControllers: map[string]RKEK8sWindowsSystemImageController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -1277,3 +1305,55 @@ func (c *Client) ClusterTemplateRevisions(namespace string) ClusterTemplateRevis
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type RKEK8sSystemImagesGetter interface {
|
||||
RKEK8sSystemImages(namespace string) RKEK8sSystemImageInterface
|
||||
}
|
||||
|
||||
func (c *Client) RKEK8sSystemImages(namespace string) RKEK8sSystemImageInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &RKEK8sSystemImageResource, RKEK8sSystemImageGroupVersionKind, rkeK8sSystemImageFactory{})
|
||||
return &rkeK8sSystemImageClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionsGetter interface {
|
||||
RKEK8sServiceOptions(namespace string) RKEK8sServiceOptionInterface
|
||||
}
|
||||
|
||||
func (c *Client) RKEK8sServiceOptions(namespace string) RKEK8sServiceOptionInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &RKEK8sServiceOptionResource, RKEK8sServiceOptionGroupVersionKind, rkeK8sServiceOptionFactory{})
|
||||
return &rkeK8sServiceOptionClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type RKEAddonsGetter interface {
|
||||
RKEAddons(namespace string) RKEAddonInterface
|
||||
}
|
||||
|
||||
func (c *Client) RKEAddons(namespace string) RKEAddonInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &RKEAddonResource, RKEAddonGroupVersionKind, rkeAddonFactory{})
|
||||
return &rkeAddonClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImagesGetter interface {
|
||||
RKEK8sWindowsSystemImages(namespace string) RKEK8sWindowsSystemImageInterface
|
||||
}
|
||||
|
||||
func (c *Client) RKEK8sWindowsSystemImages(namespace string) RKEK8sWindowsSystemImageInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &RKEK8sWindowsSystemImageResource, RKEK8sWindowsSystemImageGroupVersionKind, rkeK8sWindowsSystemImageFactory{})
|
||||
return &rkeK8sWindowsSystemImageClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,505 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
RKEAddonGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "RKEAddon",
|
||||
}
|
||||
RKEAddonResource = metav1.APIResource{
|
||||
Name: "rkeaddons",
|
||||
SingularName: "rkeaddon",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: RKEAddonGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
RKEAddonGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "rkeaddons",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(RKEAddonGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewRKEAddon(namespace, name string, obj RKEAddon) *RKEAddon {
|
||||
obj.APIVersion, obj.Kind = RKEAddonGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type RKEAddonList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []RKEAddon `json:"items"`
|
||||
}
|
||||
|
||||
type RKEAddonHandlerFunc func(key string, obj *RKEAddon) (runtime.Object, error)
|
||||
|
||||
type RKEAddonChangeHandlerFunc func(obj *RKEAddon) (runtime.Object, error)
|
||||
|
||||
type RKEAddonLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*RKEAddon, err error)
|
||||
Get(namespace, name string) (*RKEAddon, error)
|
||||
}
|
||||
|
||||
type RKEAddonController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() RKEAddonLister
|
||||
AddHandler(ctx context.Context, name string, handler RKEAddonHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEAddonHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RKEAddonHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RKEAddonHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type RKEAddonInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*RKEAddon) (*RKEAddon, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEAddon, error)
|
||||
Get(name string, opts metav1.GetOptions) (*RKEAddon, error)
|
||||
Update(*RKEAddon) (*RKEAddon, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*RKEAddonList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() RKEAddonController
|
||||
AddHandler(ctx context.Context, name string, sync RKEAddonHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEAddonHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle RKEAddonLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEAddonLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEAddonHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEAddonHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEAddonLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEAddonLifecycle)
|
||||
}
|
||||
|
||||
type rkeAddonLister struct {
|
||||
controller *rkeAddonController
|
||||
}
|
||||
|
||||
func (l *rkeAddonLister) List(namespace string, selector labels.Selector) (ret []*RKEAddon, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*RKEAddon))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *rkeAddonLister) Get(namespace, name string) (*RKEAddon, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: RKEAddonGroupVersionKind.Group,
|
||||
Resource: "rkeAddon",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*RKEAddon), nil
|
||||
}
|
||||
|
||||
type rkeAddonController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeAddonController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeAddonController) Lister() RKEAddonLister {
|
||||
return &rkeAddonLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *rkeAddonController) AddHandler(ctx context.Context, name string, handler RKEAddonHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEAddon); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeAddonController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RKEAddonHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEAddon); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeAddonController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RKEAddonHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEAddonGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEAddon); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeAddonController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RKEAddonHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEAddonGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEAddon); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type rkeAddonFactory struct {
|
||||
}
|
||||
|
||||
func (c rkeAddonFactory) Object() runtime.Object {
|
||||
return &RKEAddon{}
|
||||
}
|
||||
|
||||
func (c rkeAddonFactory) List() runtime.Object {
|
||||
return &RKEAddonList{}
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) Controller() RKEAddonController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.rkeAddonControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(RKEAddonGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &rkeAddonController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.rkeAddonControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type rkeAddonClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller RKEAddonController
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) Create(o *RKEAddon) (*RKEAddon, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*RKEAddon), err
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) Get(name string, opts metav1.GetOptions) (*RKEAddon, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*RKEAddon), err
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEAddon, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*RKEAddon), err
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) Update(o *RKEAddon) (*RKEAddon, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*RKEAddon), err
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) List(opts metav1.ListOptions) (*RKEAddonList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*RKEAddonList), err
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *rkeAddonClient) Patch(o *RKEAddon, patchType types.PatchType, data []byte, subresources ...string) (*RKEAddon, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*RKEAddon), err
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddHandler(ctx context.Context, name string, sync RKEAddonHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEAddonHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddLifecycle(ctx context.Context, name string, lifecycle RKEAddonLifecycle) {
|
||||
sync := NewRKEAddonLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEAddonLifecycle) {
|
||||
sync := NewRKEAddonLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEAddonHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEAddonHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEAddonLifecycle) {
|
||||
sync := NewRKEAddonLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeAddonClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEAddonLifecycle) {
|
||||
sync := NewRKEAddonLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type RKEAddonIndexer func(obj *RKEAddon) ([]string, error)
|
||||
|
||||
type RKEAddonClientCache interface {
|
||||
Get(namespace, name string) (*RKEAddon, error)
|
||||
List(namespace string, selector labels.Selector) ([]*RKEAddon, error)
|
||||
|
||||
Index(name string, indexer RKEAddonIndexer)
|
||||
GetIndexed(name, key string) ([]*RKEAddon, error)
|
||||
}
|
||||
|
||||
type RKEAddonClient interface {
|
||||
Create(*RKEAddon) (*RKEAddon, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*RKEAddon, error)
|
||||
Update(*RKEAddon) (*RKEAddon, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*RKEAddonList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() RKEAddonClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync RKEAddonChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync RKEAddonChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync RKEAddonChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() RKEAddonInterface
|
||||
}
|
||||
|
||||
type rkeAddonClientCache struct {
|
||||
client *rkeAddonClient2
|
||||
}
|
||||
|
||||
type rkeAddonClient2 struct {
|
||||
iface RKEAddonInterface
|
||||
controller RKEAddonController
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Interface() RKEAddonInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Create(obj *RKEAddon) (*RKEAddon, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Get(namespace, name string, opts metav1.GetOptions) (*RKEAddon, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Update(obj *RKEAddon) (*RKEAddon, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) List(namespace string, opts metav1.ListOptions) (*RKEAddonList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClientCache) Get(namespace, name string) (*RKEAddon, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClientCache) List(namespace string, selector labels.Selector) ([]*RKEAddon, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) Cache() RKEAddonClientCache {
|
||||
n.loadController()
|
||||
return &rkeAddonClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) OnCreate(ctx context.Context, name string, sync RKEAddonChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &rkeAddonLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) OnChange(ctx context.Context, name string, sync RKEAddonChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &rkeAddonLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) OnRemove(ctx context.Context, name string, sync RKEAddonChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &rkeAddonLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *rkeAddonClientCache) Index(name string, indexer RKEAddonIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*RKEAddon); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeAddonClientCache) GetIndexed(name, key string) ([]*RKEAddon, error) {
|
||||
var result []*RKEAddon
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*RKEAddon); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *rkeAddonClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type rkeAddonLifecycleDelegate struct {
|
||||
create RKEAddonChangeHandlerFunc
|
||||
update RKEAddonChangeHandlerFunc
|
||||
remove RKEAddonChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *rkeAddonLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *rkeAddonLifecycleDelegate) Create(obj *RKEAddon) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeAddonLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *rkeAddonLifecycleDelegate) Remove(obj *RKEAddon) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *rkeAddonLifecycleDelegate) Updated(obj *RKEAddon) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type RKEAddonLifecycle interface {
|
||||
Create(obj *RKEAddon) (runtime.Object, error)
|
||||
Remove(obj *RKEAddon) (runtime.Object, error)
|
||||
Updated(obj *RKEAddon) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type rkeAddonLifecycleAdapter struct {
|
||||
lifecycle RKEAddonLifecycle
|
||||
}
|
||||
|
||||
func (w *rkeAddonLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *rkeAddonLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *rkeAddonLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*RKEAddon))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeAddonLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*RKEAddon))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeAddonLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*RKEAddon))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewRKEAddonLifecycleAdapter(name string, clusterScoped bool, client RKEAddonInterface, l RKEAddonLifecycle) RKEAddonHandlerFunc {
|
||||
adapter := &rkeAddonLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *RKEAddon) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -0,0 +1,505 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
RKEK8sServiceOptionGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "RKEK8sServiceOption",
|
||||
}
|
||||
RKEK8sServiceOptionResource = metav1.APIResource{
|
||||
Name: "rkek8sserviceoptions",
|
||||
SingularName: "rkek8sserviceoption",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: RKEK8sServiceOptionGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
RKEK8sServiceOptionGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "rkek8sserviceoptions",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(RKEK8sServiceOptionGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewRKEK8sServiceOption(namespace, name string, obj RKEK8sServiceOption) *RKEK8sServiceOption {
|
||||
obj.APIVersion, obj.Kind = RKEK8sServiceOptionGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []RKEK8sServiceOption `json:"items"`
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionHandlerFunc func(key string, obj *RKEK8sServiceOption) (runtime.Object, error)
|
||||
|
||||
type RKEK8sServiceOptionChangeHandlerFunc func(obj *RKEK8sServiceOption) (runtime.Object, error)
|
||||
|
||||
type RKEK8sServiceOptionLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*RKEK8sServiceOption, err error)
|
||||
Get(namespace, name string) (*RKEK8sServiceOption, error)
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() RKEK8sServiceOptionLister
|
||||
AddHandler(ctx context.Context, name string, handler RKEK8sServiceOptionHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sServiceOptionHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RKEK8sServiceOptionHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RKEK8sServiceOptionHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*RKEK8sServiceOption) (*RKEK8sServiceOption, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEK8sServiceOption, error)
|
||||
Get(name string, opts metav1.GetOptions) (*RKEK8sServiceOption, error)
|
||||
Update(*RKEK8sServiceOption) (*RKEK8sServiceOption, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*RKEK8sServiceOptionList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() RKEK8sServiceOptionController
|
||||
AddHandler(ctx context.Context, name string, sync RKEK8sServiceOptionHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sServiceOptionHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle RKEK8sServiceOptionLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEK8sServiceOptionLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEK8sServiceOptionHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEK8sServiceOptionHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEK8sServiceOptionLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEK8sServiceOptionLifecycle)
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionLister struct {
|
||||
controller *rkeK8sServiceOptionController
|
||||
}
|
||||
|
||||
func (l *rkeK8sServiceOptionLister) List(namespace string, selector labels.Selector) (ret []*RKEK8sServiceOption, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*RKEK8sServiceOption))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *rkeK8sServiceOptionLister) Get(namespace, name string) (*RKEK8sServiceOption, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: RKEK8sServiceOptionGroupVersionKind.Group,
|
||||
Resource: "rkeK8sServiceOption",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*RKEK8sServiceOption), nil
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeK8sServiceOptionController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeK8sServiceOptionController) Lister() RKEK8sServiceOptionLister {
|
||||
return &rkeK8sServiceOptionLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *rkeK8sServiceOptionController) AddHandler(ctx context.Context, name string, handler RKEK8sServiceOptionHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sServiceOption); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sServiceOptionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RKEK8sServiceOptionHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sServiceOption); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sServiceOptionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RKEK8sServiceOptionHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEK8sServiceOptionGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sServiceOption); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sServiceOptionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RKEK8sServiceOptionHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEK8sServiceOptionGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sServiceOption); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionFactory struct {
|
||||
}
|
||||
|
||||
func (c rkeK8sServiceOptionFactory) Object() runtime.Object {
|
||||
return &RKEK8sServiceOption{}
|
||||
}
|
||||
|
||||
func (c rkeK8sServiceOptionFactory) List() runtime.Object {
|
||||
return &RKEK8sServiceOptionList{}
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) Controller() RKEK8sServiceOptionController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.rkeK8sServiceOptionControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(RKEK8sServiceOptionGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &rkeK8sServiceOptionController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.rkeK8sServiceOptionControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller RKEK8sServiceOptionController
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) Create(o *RKEK8sServiceOption) (*RKEK8sServiceOption, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*RKEK8sServiceOption), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) Get(name string, opts metav1.GetOptions) (*RKEK8sServiceOption, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*RKEK8sServiceOption), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEK8sServiceOption, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*RKEK8sServiceOption), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) Update(o *RKEK8sServiceOption) (*RKEK8sServiceOption, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*RKEK8sServiceOption), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) List(opts metav1.ListOptions) (*RKEK8sServiceOptionList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*RKEK8sServiceOptionList), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *rkeK8sServiceOptionClient) Patch(o *RKEK8sServiceOption, patchType types.PatchType, data []byte, subresources ...string) (*RKEK8sServiceOption, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*RKEK8sServiceOption), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddHandler(ctx context.Context, name string, sync RKEK8sServiceOptionHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sServiceOptionHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddLifecycle(ctx context.Context, name string, lifecycle RKEK8sServiceOptionLifecycle) {
|
||||
sync := NewRKEK8sServiceOptionLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEK8sServiceOptionLifecycle) {
|
||||
sync := NewRKEK8sServiceOptionLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEK8sServiceOptionHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEK8sServiceOptionHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEK8sServiceOptionLifecycle) {
|
||||
sync := NewRKEK8sServiceOptionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sServiceOptionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEK8sServiceOptionLifecycle) {
|
||||
sync := NewRKEK8sServiceOptionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionIndexer func(obj *RKEK8sServiceOption) ([]string, error)
|
||||
|
||||
type RKEK8sServiceOptionClientCache interface {
|
||||
Get(namespace, name string) (*RKEK8sServiceOption, error)
|
||||
List(namespace string, selector labels.Selector) ([]*RKEK8sServiceOption, error)
|
||||
|
||||
Index(name string, indexer RKEK8sServiceOptionIndexer)
|
||||
GetIndexed(name, key string) ([]*RKEK8sServiceOption, error)
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionClient interface {
|
||||
Create(*RKEK8sServiceOption) (*RKEK8sServiceOption, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*RKEK8sServiceOption, error)
|
||||
Update(*RKEK8sServiceOption) (*RKEK8sServiceOption, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*RKEK8sServiceOptionList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() RKEK8sServiceOptionClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync RKEK8sServiceOptionChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync RKEK8sServiceOptionChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync RKEK8sServiceOptionChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() RKEK8sServiceOptionInterface
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionClientCache struct {
|
||||
client *rkeK8sServiceOptionClient2
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionClient2 struct {
|
||||
iface RKEK8sServiceOptionInterface
|
||||
controller RKEK8sServiceOptionController
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Interface() RKEK8sServiceOptionInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Create(obj *RKEK8sServiceOption) (*RKEK8sServiceOption, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Get(namespace, name string, opts metav1.GetOptions) (*RKEK8sServiceOption, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Update(obj *RKEK8sServiceOption) (*RKEK8sServiceOption, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) List(namespace string, opts metav1.ListOptions) (*RKEK8sServiceOptionList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClientCache) Get(namespace, name string) (*RKEK8sServiceOption, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClientCache) List(namespace string, selector labels.Selector) ([]*RKEK8sServiceOption, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) Cache() RKEK8sServiceOptionClientCache {
|
||||
n.loadController()
|
||||
return &rkeK8sServiceOptionClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) OnCreate(ctx context.Context, name string, sync RKEK8sServiceOptionChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &rkeK8sServiceOptionLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) OnChange(ctx context.Context, name string, sync RKEK8sServiceOptionChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &rkeK8sServiceOptionLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) OnRemove(ctx context.Context, name string, sync RKEK8sServiceOptionChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &rkeK8sServiceOptionLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClientCache) Index(name string, indexer RKEK8sServiceOptionIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*RKEK8sServiceOption); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClientCache) GetIndexed(name, key string) ([]*RKEK8sServiceOption, error) {
|
||||
var result []*RKEK8sServiceOption
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*RKEK8sServiceOption); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionLifecycleDelegate struct {
|
||||
create RKEK8sServiceOptionChangeHandlerFunc
|
||||
update RKEK8sServiceOptionChangeHandlerFunc
|
||||
remove RKEK8sServiceOptionChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionLifecycleDelegate) Create(obj *RKEK8sServiceOption) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionLifecycleDelegate) Remove(obj *RKEK8sServiceOption) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sServiceOptionLifecycleDelegate) Updated(obj *RKEK8sServiceOption) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type RKEK8sServiceOptionLifecycle interface {
|
||||
Create(obj *RKEK8sServiceOption) (runtime.Object, error)
|
||||
Remove(obj *RKEK8sServiceOption) (runtime.Object, error)
|
||||
Updated(obj *RKEK8sServiceOption) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type rkeK8sServiceOptionLifecycleAdapter struct {
|
||||
lifecycle RKEK8sServiceOptionLifecycle
|
||||
}
|
||||
|
||||
func (w *rkeK8sServiceOptionLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *rkeK8sServiceOptionLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *rkeK8sServiceOptionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*RKEK8sServiceOption))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeK8sServiceOptionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*RKEK8sServiceOption))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeK8sServiceOptionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*RKEK8sServiceOption))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewRKEK8sServiceOptionLifecycleAdapter(name string, clusterScoped bool, client RKEK8sServiceOptionInterface, l RKEK8sServiceOptionLifecycle) RKEK8sServiceOptionHandlerFunc {
|
||||
adapter := &rkeK8sServiceOptionLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *RKEK8sServiceOption) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -0,0 +1,505 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
RKEK8sSystemImageGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "RKEK8sSystemImage",
|
||||
}
|
||||
RKEK8sSystemImageResource = metav1.APIResource{
|
||||
Name: "rkek8ssystemimages",
|
||||
SingularName: "rkek8ssystemimage",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: RKEK8sSystemImageGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
RKEK8sSystemImageGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "rkek8ssystemimages",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(RKEK8sSystemImageGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewRKEK8sSystemImage(namespace, name string, obj RKEK8sSystemImage) *RKEK8sSystemImage {
|
||||
obj.APIVersion, obj.Kind = RKEK8sSystemImageGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []RKEK8sSystemImage `json:"items"`
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageHandlerFunc func(key string, obj *RKEK8sSystemImage) (runtime.Object, error)
|
||||
|
||||
type RKEK8sSystemImageChangeHandlerFunc func(obj *RKEK8sSystemImage) (runtime.Object, error)
|
||||
|
||||
type RKEK8sSystemImageLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*RKEK8sSystemImage, err error)
|
||||
Get(namespace, name string) (*RKEK8sSystemImage, error)
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() RKEK8sSystemImageLister
|
||||
AddHandler(ctx context.Context, name string, handler RKEK8sSystemImageHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sSystemImageHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RKEK8sSystemImageHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RKEK8sSystemImageHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*RKEK8sSystemImage) (*RKEK8sSystemImage, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEK8sSystemImage, error)
|
||||
Get(name string, opts metav1.GetOptions) (*RKEK8sSystemImage, error)
|
||||
Update(*RKEK8sSystemImage) (*RKEK8sSystemImage, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*RKEK8sSystemImageList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() RKEK8sSystemImageController
|
||||
AddHandler(ctx context.Context, name string, sync RKEK8sSystemImageHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sSystemImageHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle RKEK8sSystemImageLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEK8sSystemImageLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEK8sSystemImageHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEK8sSystemImageHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEK8sSystemImageLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEK8sSystemImageLifecycle)
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageLister struct {
|
||||
controller *rkeK8sSystemImageController
|
||||
}
|
||||
|
||||
func (l *rkeK8sSystemImageLister) List(namespace string, selector labels.Selector) (ret []*RKEK8sSystemImage, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*RKEK8sSystemImage))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *rkeK8sSystemImageLister) Get(namespace, name string) (*RKEK8sSystemImage, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: RKEK8sSystemImageGroupVersionKind.Group,
|
||||
Resource: "rkeK8sSystemImage",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*RKEK8sSystemImage), nil
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeK8sSystemImageController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeK8sSystemImageController) Lister() RKEK8sSystemImageLister {
|
||||
return &rkeK8sSystemImageLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *rkeK8sSystemImageController) AddHandler(ctx context.Context, name string, handler RKEK8sSystemImageHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sSystemImage); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sSystemImageController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RKEK8sSystemImageHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sSystemImage); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sSystemImageController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RKEK8sSystemImageHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEK8sSystemImageGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sSystemImage); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sSystemImageController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RKEK8sSystemImageHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEK8sSystemImageGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sSystemImage); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageFactory struct {
|
||||
}
|
||||
|
||||
func (c rkeK8sSystemImageFactory) Object() runtime.Object {
|
||||
return &RKEK8sSystemImage{}
|
||||
}
|
||||
|
||||
func (c rkeK8sSystemImageFactory) List() runtime.Object {
|
||||
return &RKEK8sSystemImageList{}
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) Controller() RKEK8sSystemImageController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.rkeK8sSystemImageControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(RKEK8sSystemImageGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &rkeK8sSystemImageController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.rkeK8sSystemImageControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller RKEK8sSystemImageController
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) Create(o *RKEK8sSystemImage) (*RKEK8sSystemImage, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*RKEK8sSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) Get(name string, opts metav1.GetOptions) (*RKEK8sSystemImage, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*RKEK8sSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEK8sSystemImage, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*RKEK8sSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) Update(o *RKEK8sSystemImage) (*RKEK8sSystemImage, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*RKEK8sSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) List(opts metav1.ListOptions) (*RKEK8sSystemImageList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*RKEK8sSystemImageList), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *rkeK8sSystemImageClient) Patch(o *RKEK8sSystemImage, patchType types.PatchType, data []byte, subresources ...string) (*RKEK8sSystemImage, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*RKEK8sSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddHandler(ctx context.Context, name string, sync RKEK8sSystemImageHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sSystemImageHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddLifecycle(ctx context.Context, name string, lifecycle RKEK8sSystemImageLifecycle) {
|
||||
sync := NewRKEK8sSystemImageLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEK8sSystemImageLifecycle) {
|
||||
sync := NewRKEK8sSystemImageLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEK8sSystemImageHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEK8sSystemImageHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEK8sSystemImageLifecycle) {
|
||||
sync := NewRKEK8sSystemImageLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sSystemImageClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEK8sSystemImageLifecycle) {
|
||||
sync := NewRKEK8sSystemImageLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageIndexer func(obj *RKEK8sSystemImage) ([]string, error)
|
||||
|
||||
type RKEK8sSystemImageClientCache interface {
|
||||
Get(namespace, name string) (*RKEK8sSystemImage, error)
|
||||
List(namespace string, selector labels.Selector) ([]*RKEK8sSystemImage, error)
|
||||
|
||||
Index(name string, indexer RKEK8sSystemImageIndexer)
|
||||
GetIndexed(name, key string) ([]*RKEK8sSystemImage, error)
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageClient interface {
|
||||
Create(*RKEK8sSystemImage) (*RKEK8sSystemImage, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*RKEK8sSystemImage, error)
|
||||
Update(*RKEK8sSystemImage) (*RKEK8sSystemImage, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*RKEK8sSystemImageList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() RKEK8sSystemImageClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync RKEK8sSystemImageChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync RKEK8sSystemImageChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync RKEK8sSystemImageChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() RKEK8sSystemImageInterface
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageClientCache struct {
|
||||
client *rkeK8sSystemImageClient2
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageClient2 struct {
|
||||
iface RKEK8sSystemImageInterface
|
||||
controller RKEK8sSystemImageController
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Interface() RKEK8sSystemImageInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Create(obj *RKEK8sSystemImage) (*RKEK8sSystemImage, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Get(namespace, name string, opts metav1.GetOptions) (*RKEK8sSystemImage, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Update(obj *RKEK8sSystemImage) (*RKEK8sSystemImage, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) List(namespace string, opts metav1.ListOptions) (*RKEK8sSystemImageList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClientCache) Get(namespace, name string) (*RKEK8sSystemImage, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClientCache) List(namespace string, selector labels.Selector) ([]*RKEK8sSystemImage, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) Cache() RKEK8sSystemImageClientCache {
|
||||
n.loadController()
|
||||
return &rkeK8sSystemImageClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) OnCreate(ctx context.Context, name string, sync RKEK8sSystemImageChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &rkeK8sSystemImageLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) OnChange(ctx context.Context, name string, sync RKEK8sSystemImageChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &rkeK8sSystemImageLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) OnRemove(ctx context.Context, name string, sync RKEK8sSystemImageChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &rkeK8sSystemImageLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClientCache) Index(name string, indexer RKEK8sSystemImageIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*RKEK8sSystemImage); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClientCache) GetIndexed(name, key string) ([]*RKEK8sSystemImage, error) {
|
||||
var result []*RKEK8sSystemImage
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*RKEK8sSystemImage); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageLifecycleDelegate struct {
|
||||
create RKEK8sSystemImageChangeHandlerFunc
|
||||
update RKEK8sSystemImageChangeHandlerFunc
|
||||
remove RKEK8sSystemImageChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageLifecycleDelegate) Create(obj *RKEK8sSystemImage) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageLifecycleDelegate) Remove(obj *RKEK8sSystemImage) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sSystemImageLifecycleDelegate) Updated(obj *RKEK8sSystemImage) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type RKEK8sSystemImageLifecycle interface {
|
||||
Create(obj *RKEK8sSystemImage) (runtime.Object, error)
|
||||
Remove(obj *RKEK8sSystemImage) (runtime.Object, error)
|
||||
Updated(obj *RKEK8sSystemImage) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type rkeK8sSystemImageLifecycleAdapter struct {
|
||||
lifecycle RKEK8sSystemImageLifecycle
|
||||
}
|
||||
|
||||
func (w *rkeK8sSystemImageLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *rkeK8sSystemImageLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *rkeK8sSystemImageLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*RKEK8sSystemImage))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeK8sSystemImageLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*RKEK8sSystemImage))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeK8sSystemImageLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*RKEK8sSystemImage))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewRKEK8sSystemImageLifecycleAdapter(name string, clusterScoped bool, client RKEK8sSystemImageInterface, l RKEK8sSystemImageLifecycle) RKEK8sSystemImageHandlerFunc {
|
||||
adapter := &rkeK8sSystemImageLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *RKEK8sSystemImage) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -0,0 +1,505 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
RKEK8sWindowsSystemImageGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "RKEK8sWindowsSystemImage",
|
||||
}
|
||||
RKEK8sWindowsSystemImageResource = metav1.APIResource{
|
||||
Name: "rkek8swindowssystemimages",
|
||||
SingularName: "rkek8swindowssystemimage",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: RKEK8sWindowsSystemImageGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
RKEK8sWindowsSystemImageGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "rkek8swindowssystemimages",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(RKEK8sWindowsSystemImageGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewRKEK8sWindowsSystemImage(namespace, name string, obj RKEK8sWindowsSystemImage) *RKEK8sWindowsSystemImage {
|
||||
obj.APIVersion, obj.Kind = RKEK8sWindowsSystemImageGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []RKEK8sWindowsSystemImage `json:"items"`
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageHandlerFunc func(key string, obj *RKEK8sWindowsSystemImage) (runtime.Object, error)
|
||||
|
||||
type RKEK8sWindowsSystemImageChangeHandlerFunc func(obj *RKEK8sWindowsSystemImage) (runtime.Object, error)
|
||||
|
||||
type RKEK8sWindowsSystemImageLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*RKEK8sWindowsSystemImage, err error)
|
||||
Get(namespace, name string) (*RKEK8sWindowsSystemImage, error)
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() RKEK8sWindowsSystemImageLister
|
||||
AddHandler(ctx context.Context, name string, handler RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RKEK8sWindowsSystemImageHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEK8sWindowsSystemImage, error)
|
||||
Get(name string, opts metav1.GetOptions) (*RKEK8sWindowsSystemImage, error)
|
||||
Update(*RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*RKEK8sWindowsSystemImageList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() RKEK8sWindowsSystemImageController
|
||||
AddHandler(ctx context.Context, name string, sync RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle RKEK8sWindowsSystemImageLifecycle)
|
||||
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEK8sWindowsSystemImageLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEK8sWindowsSystemImageHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEK8sWindowsSystemImageLifecycle)
|
||||
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEK8sWindowsSystemImageLifecycle)
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageLister struct {
|
||||
controller *rkeK8sWindowsSystemImageController
|
||||
}
|
||||
|
||||
func (l *rkeK8sWindowsSystemImageLister) List(namespace string, selector labels.Selector) (ret []*RKEK8sWindowsSystemImage, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*RKEK8sWindowsSystemImage))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *rkeK8sWindowsSystemImageLister) Get(namespace, name string) (*RKEK8sWindowsSystemImage, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: RKEK8sWindowsSystemImageGroupVersionKind.Group,
|
||||
Resource: "rkeK8sWindowsSystemImage",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*RKEK8sWindowsSystemImage), nil
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeK8sWindowsSystemImageController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *rkeK8sWindowsSystemImageController) Lister() RKEK8sWindowsSystemImageLister {
|
||||
return &rkeK8sWindowsSystemImageLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *rkeK8sWindowsSystemImageController) AddHandler(ctx context.Context, name string, handler RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sWindowsSystemImage); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sWindowsSystemImageController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sWindowsSystemImage); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sWindowsSystemImageController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEK8sWindowsSystemImageGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sWindowsSystemImage); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *rkeK8sWindowsSystemImageController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
resource.PutClusterScoped(RKEK8sWindowsSystemImageGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
} else if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*RKEK8sWindowsSystemImage); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageFactory struct {
|
||||
}
|
||||
|
||||
func (c rkeK8sWindowsSystemImageFactory) Object() runtime.Object {
|
||||
return &RKEK8sWindowsSystemImage{}
|
||||
}
|
||||
|
||||
func (c rkeK8sWindowsSystemImageFactory) List() runtime.Object {
|
||||
return &RKEK8sWindowsSystemImageList{}
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) Controller() RKEK8sWindowsSystemImageController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.rkeK8sWindowsSystemImageControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(RKEK8sWindowsSystemImageGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &rkeK8sWindowsSystemImageController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.rkeK8sWindowsSystemImageControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller RKEK8sWindowsSystemImageController
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) Create(o *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*RKEK8sWindowsSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) Get(name string, opts metav1.GetOptions) (*RKEK8sWindowsSystemImage, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*RKEK8sWindowsSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RKEK8sWindowsSystemImage, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*RKEK8sWindowsSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) Update(o *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*RKEK8sWindowsSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) List(opts metav1.ListOptions) (*RKEK8sWindowsSystemImageList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*RKEK8sWindowsSystemImageList), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *rkeK8sWindowsSystemImageClient) Patch(o *RKEK8sWindowsSystemImage, patchType types.PatchType, data []byte, subresources ...string) (*RKEK8sWindowsSystemImage, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*RKEK8sWindowsSystemImage), err
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddHandler(ctx context.Context, name string, sync RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddLifecycle(ctx context.Context, name string, lifecycle RKEK8sWindowsSystemImageLifecycle) {
|
||||
sync := NewRKEK8sWindowsSystemImageLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RKEK8sWindowsSystemImageLifecycle) {
|
||||
sync := NewRKEK8sWindowsSystemImageLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RKEK8sWindowsSystemImageHandlerFunc) {
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RKEK8sWindowsSystemImageLifecycle) {
|
||||
sync := NewRKEK8sWindowsSystemImageLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *rkeK8sWindowsSystemImageClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RKEK8sWindowsSystemImageLifecycle) {
|
||||
sync := NewRKEK8sWindowsSystemImageLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageIndexer func(obj *RKEK8sWindowsSystemImage) ([]string, error)
|
||||
|
||||
type RKEK8sWindowsSystemImageClientCache interface {
|
||||
Get(namespace, name string) (*RKEK8sWindowsSystemImage, error)
|
||||
List(namespace string, selector labels.Selector) ([]*RKEK8sWindowsSystemImage, error)
|
||||
|
||||
Index(name string, indexer RKEK8sWindowsSystemImageIndexer)
|
||||
GetIndexed(name, key string) ([]*RKEK8sWindowsSystemImage, error)
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageClient interface {
|
||||
Create(*RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*RKEK8sWindowsSystemImage, error)
|
||||
Update(*RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*RKEK8sWindowsSystemImageList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() RKEK8sWindowsSystemImageClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync RKEK8sWindowsSystemImageChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync RKEK8sWindowsSystemImageChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync RKEK8sWindowsSystemImageChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() RKEK8sWindowsSystemImageInterface
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageClientCache struct {
|
||||
client *rkeK8sWindowsSystemImageClient2
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageClient2 struct {
|
||||
iface RKEK8sWindowsSystemImageInterface
|
||||
controller RKEK8sWindowsSystemImageController
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Interface() RKEK8sWindowsSystemImageInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Create(obj *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Get(namespace, name string, opts metav1.GetOptions) (*RKEK8sWindowsSystemImage, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Update(obj *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) List(namespace string, opts metav1.ListOptions) (*RKEK8sWindowsSystemImageList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClientCache) Get(namespace, name string) (*RKEK8sWindowsSystemImage, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClientCache) List(namespace string, selector labels.Selector) ([]*RKEK8sWindowsSystemImage, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) Cache() RKEK8sWindowsSystemImageClientCache {
|
||||
n.loadController()
|
||||
return &rkeK8sWindowsSystemImageClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) OnCreate(ctx context.Context, name string, sync RKEK8sWindowsSystemImageChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &rkeK8sWindowsSystemImageLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) OnChange(ctx context.Context, name string, sync RKEK8sWindowsSystemImageChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &rkeK8sWindowsSystemImageLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) OnRemove(ctx context.Context, name string, sync RKEK8sWindowsSystemImageChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &rkeK8sWindowsSystemImageLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClientCache) Index(name string, indexer RKEK8sWindowsSystemImageIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*RKEK8sWindowsSystemImage); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClientCache) GetIndexed(name, key string) ([]*RKEK8sWindowsSystemImage, error) {
|
||||
var result []*RKEK8sWindowsSystemImage
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*RKEK8sWindowsSystemImage); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageLifecycleDelegate struct {
|
||||
create RKEK8sWindowsSystemImageChangeHandlerFunc
|
||||
update RKEK8sWindowsSystemImageChangeHandlerFunc
|
||||
remove RKEK8sWindowsSystemImageChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageLifecycleDelegate) Create(obj *RKEK8sWindowsSystemImage) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageLifecycleDelegate) Remove(obj *RKEK8sWindowsSystemImage) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *rkeK8sWindowsSystemImageLifecycleDelegate) Updated(obj *RKEK8sWindowsSystemImage) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type RKEK8sWindowsSystemImageLifecycle interface {
|
||||
Create(obj *RKEK8sWindowsSystemImage) (runtime.Object, error)
|
||||
Remove(obj *RKEK8sWindowsSystemImage) (runtime.Object, error)
|
||||
Updated(obj *RKEK8sWindowsSystemImage) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type rkeK8sWindowsSystemImageLifecycleAdapter struct {
|
||||
lifecycle RKEK8sWindowsSystemImageLifecycle
|
||||
}
|
||||
|
||||
func (w *rkeK8sWindowsSystemImageLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *rkeK8sWindowsSystemImageLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *rkeK8sWindowsSystemImageLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*RKEK8sWindowsSystemImage))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeK8sWindowsSystemImageLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*RKEK8sWindowsSystemImage))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *rkeK8sWindowsSystemImageLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*RKEK8sWindowsSystemImage))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewRKEK8sWindowsSystemImageLifecycleAdapter(name string, clusterScoped bool, client RKEK8sWindowsSystemImageInterface, l RKEK8sWindowsSystemImageLifecycle) RKEK8sWindowsSystemImageHandlerFunc {
|
||||
adapter := &rkeK8sWindowsSystemImageLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *RKEK8sWindowsSystemImage) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -151,6 +151,14 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&ClusterTemplateList{},
|
||||
&ClusterTemplateRevision{},
|
||||
&ClusterTemplateRevisionList{},
|
||||
&RKEK8sSystemImage{},
|
||||
&RKEK8sSystemImageList{},
|
||||
&RKEK8sServiceOption{},
|
||||
&RKEK8sServiceOptionList{},
|
||||
&RKEAddon{},
|
||||
&RKEAddonList{},
|
||||
&RKEK8sWindowsSystemImage{},
|
||||
&RKEK8sWindowsSystemImageList{},
|
||||
)
|
||||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
|
@ -66,6 +66,10 @@ type Client struct {
|
||||
ManagementSecret ManagementSecretOperations
|
||||
ClusterTemplate ClusterTemplateOperations
|
||||
ClusterTemplateRevision ClusterTemplateRevisionOperations
|
||||
RKEK8sSystemImage RKEK8sSystemImageOperations
|
||||
RKEK8sServiceOption RKEK8sServiceOptionOperations
|
||||
RKEAddon RKEAddonOperations
|
||||
RKEK8sWindowsSystemImage RKEK8sWindowsSystemImageOperations
|
||||
}
|
||||
|
||||
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
@ -137,6 +141,10 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
client.ManagementSecret = newManagementSecretClient(client)
|
||||
client.ClusterTemplate = newClusterTemplateClient(client)
|
||||
client.ClusterTemplateRevision = newClusterTemplateRevisionClient(client)
|
||||
client.RKEK8sSystemImage = newRKEK8sSystemImageClient(client)
|
||||
client.RKEK8sServiceOption = newRKEK8sServiceOptionClient(client)
|
||||
client.RKEAddon = newRKEAddonClient(client)
|
||||
client.RKEK8sWindowsSystemImage = newRKEK8sWindowsSystemImageClient(client)
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
KubernetesServicesOptionsType = "kubernetesServicesOptions"
|
||||
KubernetesServicesOptionsFieldKubeAPI = "kubeapi"
|
||||
KubernetesServicesOptionsFieldKubeController = "kubeController"
|
||||
KubernetesServicesOptionsFieldKubelet = "kubelet"
|
||||
KubernetesServicesOptionsFieldKubeproxy = "kubeproxy"
|
||||
KubernetesServicesOptionsFieldScheduler = "scheduler"
|
||||
)
|
||||
|
||||
type KubernetesServicesOptions struct {
|
||||
KubeAPI map[string]string `json:"kubeapi,omitempty" yaml:"kubeapi,omitempty"`
|
||||
KubeController map[string]string `json:"kubeController,omitempty" yaml:"kubeController,omitempty"`
|
||||
Kubelet map[string]string `json:"kubelet,omitempty" yaml:"kubelet,omitempty"`
|
||||
Kubeproxy map[string]string `json:"kubeproxy,omitempty" yaml:"kubeproxy,omitempty"`
|
||||
Scheduler map[string]string `json:"scheduler,omitempty" yaml:"scheduler,omitempty"`
|
||||
}
|
101
client/management/v3/zz_generated_rke_addon.go
Normal file
101
client/management/v3/zz_generated_rke_addon.go
Normal file
@ -0,0 +1,101 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
RKEAddonType = "rkeAddon"
|
||||
RKEAddonFieldAnnotations = "annotations"
|
||||
RKEAddonFieldCreated = "created"
|
||||
RKEAddonFieldCreatorID = "creatorId"
|
||||
RKEAddonFieldLabels = "labels"
|
||||
RKEAddonFieldName = "name"
|
||||
RKEAddonFieldOwnerReferences = "ownerReferences"
|
||||
RKEAddonFieldRemoved = "removed"
|
||||
RKEAddonFieldTemplate = "template"
|
||||
RKEAddonFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type RKEAddon struct {
|
||||
types.Resource
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
Template string `json:"template,omitempty" yaml:"template,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
||||
|
||||
type RKEAddonCollection struct {
|
||||
types.Collection
|
||||
Data []RKEAddon `json:"data,omitempty"`
|
||||
client *RKEAddonClient
|
||||
}
|
||||
|
||||
type RKEAddonClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type RKEAddonOperations interface {
|
||||
List(opts *types.ListOpts) (*RKEAddonCollection, error)
|
||||
Create(opts *RKEAddon) (*RKEAddon, error)
|
||||
Update(existing *RKEAddon, updates interface{}) (*RKEAddon, error)
|
||||
Replace(existing *RKEAddon) (*RKEAddon, error)
|
||||
ByID(id string) (*RKEAddon, error)
|
||||
Delete(container *RKEAddon) error
|
||||
}
|
||||
|
||||
func newRKEAddonClient(apiClient *Client) *RKEAddonClient {
|
||||
return &RKEAddonClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RKEAddonClient) Create(container *RKEAddon) (*RKEAddon, error) {
|
||||
resp := &RKEAddon{}
|
||||
err := c.apiClient.Ops.DoCreate(RKEAddonType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEAddonClient) Update(existing *RKEAddon, updates interface{}) (*RKEAddon, error) {
|
||||
resp := &RKEAddon{}
|
||||
err := c.apiClient.Ops.DoUpdate(RKEAddonType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEAddonClient) Replace(obj *RKEAddon) (*RKEAddon, error) {
|
||||
resp := &RKEAddon{}
|
||||
err := c.apiClient.Ops.DoReplace(RKEAddonType, &obj.Resource, obj, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEAddonClient) List(opts *types.ListOpts) (*RKEAddonCollection, error) {
|
||||
resp := &RKEAddonCollection{}
|
||||
err := c.apiClient.Ops.DoList(RKEAddonType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *RKEAddonCollection) Next() (*RKEAddonCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &RKEAddonCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *RKEAddonClient) ByID(id string) (*RKEAddon, error) {
|
||||
resp := &RKEAddon{}
|
||||
err := c.apiClient.Ops.DoByID(RKEAddonType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEAddonClient) Delete(container *RKEAddon) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(RKEAddonType, &container.Resource)
|
||||
}
|
101
client/management/v3/zz_generated_rke_k8s_service_option.go
Normal file
101
client/management/v3/zz_generated_rke_k8s_service_option.go
Normal file
@ -0,0 +1,101 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
RKEK8sServiceOptionType = "rkeK8sServiceOption"
|
||||
RKEK8sServiceOptionFieldAnnotations = "annotations"
|
||||
RKEK8sServiceOptionFieldCreated = "created"
|
||||
RKEK8sServiceOptionFieldCreatorID = "creatorId"
|
||||
RKEK8sServiceOptionFieldLabels = "labels"
|
||||
RKEK8sServiceOptionFieldName = "name"
|
||||
RKEK8sServiceOptionFieldOwnerReferences = "ownerReferences"
|
||||
RKEK8sServiceOptionFieldRemoved = "removed"
|
||||
RKEK8sServiceOptionFieldServiceOptions = "serviceOptions"
|
||||
RKEK8sServiceOptionFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type RKEK8sServiceOption struct {
|
||||
types.Resource
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
ServiceOptions *KubernetesServicesOptions `json:"serviceOptions,omitempty" yaml:"serviceOptions,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionCollection struct {
|
||||
types.Collection
|
||||
Data []RKEK8sServiceOption `json:"data,omitempty"`
|
||||
client *RKEK8sServiceOptionClient
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type RKEK8sServiceOptionOperations interface {
|
||||
List(opts *types.ListOpts) (*RKEK8sServiceOptionCollection, error)
|
||||
Create(opts *RKEK8sServiceOption) (*RKEK8sServiceOption, error)
|
||||
Update(existing *RKEK8sServiceOption, updates interface{}) (*RKEK8sServiceOption, error)
|
||||
Replace(existing *RKEK8sServiceOption) (*RKEK8sServiceOption, error)
|
||||
ByID(id string) (*RKEK8sServiceOption, error)
|
||||
Delete(container *RKEK8sServiceOption) error
|
||||
}
|
||||
|
||||
func newRKEK8sServiceOptionClient(apiClient *Client) *RKEK8sServiceOptionClient {
|
||||
return &RKEK8sServiceOptionClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RKEK8sServiceOptionClient) Create(container *RKEK8sServiceOption) (*RKEK8sServiceOption, error) {
|
||||
resp := &RKEK8sServiceOption{}
|
||||
err := c.apiClient.Ops.DoCreate(RKEK8sServiceOptionType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sServiceOptionClient) Update(existing *RKEK8sServiceOption, updates interface{}) (*RKEK8sServiceOption, error) {
|
||||
resp := &RKEK8sServiceOption{}
|
||||
err := c.apiClient.Ops.DoUpdate(RKEK8sServiceOptionType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sServiceOptionClient) Replace(obj *RKEK8sServiceOption) (*RKEK8sServiceOption, error) {
|
||||
resp := &RKEK8sServiceOption{}
|
||||
err := c.apiClient.Ops.DoReplace(RKEK8sServiceOptionType, &obj.Resource, obj, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sServiceOptionClient) List(opts *types.ListOpts) (*RKEK8sServiceOptionCollection, error) {
|
||||
resp := &RKEK8sServiceOptionCollection{}
|
||||
err := c.apiClient.Ops.DoList(RKEK8sServiceOptionType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *RKEK8sServiceOptionCollection) Next() (*RKEK8sServiceOptionCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &RKEK8sServiceOptionCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *RKEK8sServiceOptionClient) ByID(id string) (*RKEK8sServiceOption, error) {
|
||||
resp := &RKEK8sServiceOption{}
|
||||
err := c.apiClient.Ops.DoByID(RKEK8sServiceOptionType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sServiceOptionClient) Delete(container *RKEK8sServiceOption) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(RKEK8sServiceOptionType, &container.Resource)
|
||||
}
|
101
client/management/v3/zz_generated_rke_k8s_system_image.go
Normal file
101
client/management/v3/zz_generated_rke_k8s_system_image.go
Normal file
@ -0,0 +1,101 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
RKEK8sSystemImageType = "rkeK8sSystemImage"
|
||||
RKEK8sSystemImageFieldAnnotations = "annotations"
|
||||
RKEK8sSystemImageFieldCreated = "created"
|
||||
RKEK8sSystemImageFieldCreatorID = "creatorId"
|
||||
RKEK8sSystemImageFieldLabels = "labels"
|
||||
RKEK8sSystemImageFieldName = "name"
|
||||
RKEK8sSystemImageFieldOwnerReferences = "ownerReferences"
|
||||
RKEK8sSystemImageFieldRemoved = "removed"
|
||||
RKEK8sSystemImageFieldSystemImages = "systemImages"
|
||||
RKEK8sSystemImageFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type RKEK8sSystemImage struct {
|
||||
types.Resource
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
SystemImages *RKESystemImages `json:"systemImages,omitempty" yaml:"systemImages,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageCollection struct {
|
||||
types.Collection
|
||||
Data []RKEK8sSystemImage `json:"data,omitempty"`
|
||||
client *RKEK8sSystemImageClient
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type RKEK8sSystemImageOperations interface {
|
||||
List(opts *types.ListOpts) (*RKEK8sSystemImageCollection, error)
|
||||
Create(opts *RKEK8sSystemImage) (*RKEK8sSystemImage, error)
|
||||
Update(existing *RKEK8sSystemImage, updates interface{}) (*RKEK8sSystemImage, error)
|
||||
Replace(existing *RKEK8sSystemImage) (*RKEK8sSystemImage, error)
|
||||
ByID(id string) (*RKEK8sSystemImage, error)
|
||||
Delete(container *RKEK8sSystemImage) error
|
||||
}
|
||||
|
||||
func newRKEK8sSystemImageClient(apiClient *Client) *RKEK8sSystemImageClient {
|
||||
return &RKEK8sSystemImageClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RKEK8sSystemImageClient) Create(container *RKEK8sSystemImage) (*RKEK8sSystemImage, error) {
|
||||
resp := &RKEK8sSystemImage{}
|
||||
err := c.apiClient.Ops.DoCreate(RKEK8sSystemImageType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sSystemImageClient) Update(existing *RKEK8sSystemImage, updates interface{}) (*RKEK8sSystemImage, error) {
|
||||
resp := &RKEK8sSystemImage{}
|
||||
err := c.apiClient.Ops.DoUpdate(RKEK8sSystemImageType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sSystemImageClient) Replace(obj *RKEK8sSystemImage) (*RKEK8sSystemImage, error) {
|
||||
resp := &RKEK8sSystemImage{}
|
||||
err := c.apiClient.Ops.DoReplace(RKEK8sSystemImageType, &obj.Resource, obj, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sSystemImageClient) List(opts *types.ListOpts) (*RKEK8sSystemImageCollection, error) {
|
||||
resp := &RKEK8sSystemImageCollection{}
|
||||
err := c.apiClient.Ops.DoList(RKEK8sSystemImageType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *RKEK8sSystemImageCollection) Next() (*RKEK8sSystemImageCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &RKEK8sSystemImageCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *RKEK8sSystemImageClient) ByID(id string) (*RKEK8sSystemImage, error) {
|
||||
resp := &RKEK8sSystemImage{}
|
||||
err := c.apiClient.Ops.DoByID(RKEK8sSystemImageType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sSystemImageClient) Delete(container *RKEK8sSystemImage) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(RKEK8sSystemImageType, &container.Resource)
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
RKEK8sWindowsSystemImageType = "rkeK8sWindowsSystemImage"
|
||||
RKEK8sWindowsSystemImageFieldAnnotations = "annotations"
|
||||
RKEK8sWindowsSystemImageFieldCreated = "created"
|
||||
RKEK8sWindowsSystemImageFieldCreatorID = "creatorId"
|
||||
RKEK8sWindowsSystemImageFieldLabels = "labels"
|
||||
RKEK8sWindowsSystemImageFieldName = "name"
|
||||
RKEK8sWindowsSystemImageFieldOwnerReferences = "ownerReferences"
|
||||
RKEK8sWindowsSystemImageFieldRemoved = "removed"
|
||||
RKEK8sWindowsSystemImageFieldSystemImages = "windowsSystemImages"
|
||||
RKEK8sWindowsSystemImageFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type RKEK8sWindowsSystemImage struct {
|
||||
types.Resource
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
SystemImages *WindowsSystemImages `json:"windowsSystemImages,omitempty" yaml:"windowsSystemImages,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageCollection struct {
|
||||
types.Collection
|
||||
Data []RKEK8sWindowsSystemImage `json:"data,omitempty"`
|
||||
client *RKEK8sWindowsSystemImageClient
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type RKEK8sWindowsSystemImageOperations interface {
|
||||
List(opts *types.ListOpts) (*RKEK8sWindowsSystemImageCollection, error)
|
||||
Create(opts *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error)
|
||||
Update(existing *RKEK8sWindowsSystemImage, updates interface{}) (*RKEK8sWindowsSystemImage, error)
|
||||
Replace(existing *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error)
|
||||
ByID(id string) (*RKEK8sWindowsSystemImage, error)
|
||||
Delete(container *RKEK8sWindowsSystemImage) error
|
||||
}
|
||||
|
||||
func newRKEK8sWindowsSystemImageClient(apiClient *Client) *RKEK8sWindowsSystemImageClient {
|
||||
return &RKEK8sWindowsSystemImageClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RKEK8sWindowsSystemImageClient) Create(container *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error) {
|
||||
resp := &RKEK8sWindowsSystemImage{}
|
||||
err := c.apiClient.Ops.DoCreate(RKEK8sWindowsSystemImageType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sWindowsSystemImageClient) Update(existing *RKEK8sWindowsSystemImage, updates interface{}) (*RKEK8sWindowsSystemImage, error) {
|
||||
resp := &RKEK8sWindowsSystemImage{}
|
||||
err := c.apiClient.Ops.DoUpdate(RKEK8sWindowsSystemImageType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sWindowsSystemImageClient) Replace(obj *RKEK8sWindowsSystemImage) (*RKEK8sWindowsSystemImage, error) {
|
||||
resp := &RKEK8sWindowsSystemImage{}
|
||||
err := c.apiClient.Ops.DoReplace(RKEK8sWindowsSystemImageType, &obj.Resource, obj, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sWindowsSystemImageClient) List(opts *types.ListOpts) (*RKEK8sWindowsSystemImageCollection, error) {
|
||||
resp := &RKEK8sWindowsSystemImageCollection{}
|
||||
err := c.apiClient.Ops.DoList(RKEK8sWindowsSystemImageType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *RKEK8sWindowsSystemImageCollection) Next() (*RKEK8sWindowsSystemImageCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &RKEK8sWindowsSystemImageCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *RKEK8sWindowsSystemImageClient) ByID(id string) (*RKEK8sWindowsSystemImage, error) {
|
||||
resp := &RKEK8sWindowsSystemImage{}
|
||||
err := c.apiClient.Ops.DoByID(RKEK8sWindowsSystemImageType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RKEK8sWindowsSystemImageClient) Delete(container *RKEK8sWindowsSystemImage) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(RKEK8sWindowsSystemImageType, &container.Resource)
|
||||
}
|
20
client/management/v3/zz_generated_windows_system_images.go
Normal file
20
client/management/v3/zz_generated_windows_system_images.go
Normal file
@ -0,0 +1,20 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
WindowsSystemImagesType = "windowsSystemImages"
|
||||
WindowsSystemImagesFieldCalicoCNIBinaries = "calicoCniBinaries"
|
||||
WindowsSystemImagesFieldCanalCNIBinaries = "canalCniBinaries"
|
||||
WindowsSystemImagesFieldFlannelCNIBinaries = "flannelCniBinaries"
|
||||
WindowsSystemImagesFieldKubeletPause = "kubeletPause"
|
||||
WindowsSystemImagesFieldKubernetesBinaries = "kubernetesBinaries"
|
||||
WindowsSystemImagesFieldNginxProxy = "nginxProxy"
|
||||
)
|
||||
|
||||
type WindowsSystemImages struct {
|
||||
CalicoCNIBinaries string `json:"calicoCniBinaries,omitempty" yaml:"calicoCniBinaries,omitempty"`
|
||||
CanalCNIBinaries string `json:"canalCniBinaries,omitempty" yaml:"canalCniBinaries,omitempty"`
|
||||
FlannelCNIBinaries string `json:"flannelCniBinaries,omitempty" yaml:"flannelCniBinaries,omitempty"`
|
||||
KubeletPause string `json:"kubeletPause,omitempty" yaml:"kubeletPause,omitempty"`
|
||||
KubernetesBinaries string `json:"kubernetesBinaries,omitempty" yaml:"kubernetesBinaries,omitempty"`
|
||||
NginxProxy string `json:"nginxProxy,omitempty" yaml:"nginxProxy,omitempty"`
|
||||
}
|
@ -64,6 +64,10 @@ type Config struct {
|
||||
ManagementSecrets map[string]managementClient.ManagementSecret `json:"managementSecrets,omitempty" yaml:"managementSecrets,omitempty"`
|
||||
ClusterTemplates map[string]managementClient.ClusterTemplate `json:"clusterTemplates,omitempty" yaml:"clusterTemplates,omitempty"`
|
||||
ClusterTemplateRevisions map[string]managementClient.ClusterTemplateRevision `json:"clusterTemplateRevisions,omitempty" yaml:"clusterTemplateRevisions,omitempty"`
|
||||
RKEK8sSystemImages map[string]managementClient.RKEK8sSystemImage `json:"rkeK8sSystemImages,omitempty" yaml:"rkeK8sSystemImages,omitempty"`
|
||||
RKEK8sServiceOptions map[string]managementClient.RKEK8sServiceOption `json:"rkeK8sServiceOptions,omitempty" yaml:"rkeK8sServiceOptions,omitempty"`
|
||||
RKEAddons map[string]managementClient.RKEAddon `json:"rkeAddons,omitempty" yaml:"rkeAddons,omitempty"`
|
||||
RKEK8sWindowsSystemImages map[string]managementClient.RKEK8sWindowsSystemImage `json:"rkeK8sWindowsSystemImages,omitempty" yaml:"rkeK8sWindowsSystemImages,omitempty"`
|
||||
|
||||
// Cluster Client
|
||||
Namespaces map[string]clusterClient.Namespace `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user