From 4ebac5f61fcd25f76b4000914664620012baf314 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Tue, 10 Nov 2020 23:01:37 +0800 Subject: [PATCH] add generated files Signed-off-by: Kevin Wang --- .../v1alpha1/zz_generated.deepcopy.go | 176 ++++++++ .../v1alpha1/zz_generated.deepcopy.go | 397 ++++++++++++++++++ .../clientset/versioned/clientset.go | 95 +++++ pkg/generated/clientset/versioned/doc.go | 4 + .../versioned/fake/clientset_generated.go | 73 ++++ pkg/generated/clientset/versioned/fake/doc.go | 4 + .../clientset/versioned/fake/register.go | 42 ++ .../clientset/versioned/scheme/doc.go | 4 + .../clientset/versioned/scheme/register.go | 42 ++ .../typed/membercluster/v1alpha1/doc.go | 4 + .../typed/membercluster/v1alpha1/fake/doc.go | 4 + .../v1alpha1/fake/fake_membercluster.go | 126 ++++++ .../fake/fake_membercluster_client.go | 24 ++ .../v1alpha1/generated_expansion.go | 5 + .../membercluster/v1alpha1/membercluster.go | 179 ++++++++ .../v1alpha1/membercluster_client.go | 73 ++++ .../typed/propagationstrategy/v1alpha1/doc.go | 4 + .../propagationstrategy/v1alpha1/fake/doc.go | 4 + .../v1alpha1/fake/fake_propagationbinding.go | 126 ++++++ .../fake/fake_propagationstrategy_client.go | 28 ++ .../v1alpha1/fake/fake_propagationwork.go | 126 ++++++ .../v1alpha1/generated_expansion.go | 7 + .../v1alpha1/propagationbinding.go | 179 ++++++++ .../v1alpha1/propagationstrategy_client.go | 78 ++++ .../v1alpha1/propagationwork.go | 179 ++++++++ .../informers/externalversions/factory.go | 170 ++++++++ .../informers/externalversions/generic.go | 53 +++ .../internalinterfaces/factory_interfaces.go | 24 ++ .../membercluster/interface.go | 30 ++ .../membercluster/v1alpha1/interface.go | 29 ++ .../membercluster/v1alpha1/membercluster.go | 74 ++++ .../propagationstrategy/interface.go | 30 ++ .../propagationstrategy/v1alpha1/interface.go | 36 ++ .../v1alpha1/propagationbinding.go | 74 ++++ .../v1alpha1/propagationwork.go | 74 ++++ .../v1alpha1/expansion_generated.go | 11 + .../membercluster/v1alpha1/membercluster.go | 83 ++++ .../v1alpha1/expansion_generated.go | 19 + .../v1alpha1/propagationbinding.go | 83 ++++ .../v1alpha1/propagationwork.go | 83 ++++ 40 files changed, 2856 insertions(+) create mode 100644 pkg/apis/membercluster/v1alpha1/zz_generated.deepcopy.go create mode 100644 pkg/apis/propagationstrategy/v1alpha1/zz_generated.deepcopy.go create mode 100644 pkg/generated/clientset/versioned/clientset.go create mode 100644 pkg/generated/clientset/versioned/doc.go create mode 100644 pkg/generated/clientset/versioned/fake/clientset_generated.go create mode 100644 pkg/generated/clientset/versioned/fake/doc.go create mode 100644 pkg/generated/clientset/versioned/fake/register.go create mode 100644 pkg/generated/clientset/versioned/scheme/doc.go create mode 100644 pkg/generated/clientset/versioned/scheme/register.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster_client.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/generated_expansion.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster.go create mode 100644 pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster_client.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationbinding.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationstrategy_client.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationwork.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/generated_expansion.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationbinding.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationstrategy_client.go create mode 100644 pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationwork.go create mode 100644 pkg/generated/informers/externalversions/factory.go create mode 100644 pkg/generated/informers/externalversions/generic.go create mode 100644 pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 pkg/generated/informers/externalversions/membercluster/interface.go create mode 100644 pkg/generated/informers/externalversions/membercluster/v1alpha1/interface.go create mode 100644 pkg/generated/informers/externalversions/membercluster/v1alpha1/membercluster.go create mode 100644 pkg/generated/informers/externalversions/propagationstrategy/interface.go create mode 100644 pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/interface.go create mode 100644 pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationbinding.go create mode 100644 pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationwork.go create mode 100644 pkg/generated/listers/membercluster/v1alpha1/expansion_generated.go create mode 100644 pkg/generated/listers/membercluster/v1alpha1/membercluster.go create mode 100644 pkg/generated/listers/propagationstrategy/v1alpha1/expansion_generated.go create mode 100644 pkg/generated/listers/propagationstrategy/v1alpha1/propagationbinding.go create mode 100644 pkg/generated/listers/propagationstrategy/v1alpha1/propagationwork.go diff --git a/pkg/apis/membercluster/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/membercluster/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..0526ff939 --- /dev/null +++ b/pkg/apis/membercluster/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,176 @@ +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalSecretReference. +func (in *LocalSecretReference) DeepCopy() *LocalSecretReference { + if in == nil { + return nil + } + out := new(LocalSecretReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MemberCluster) DeepCopyInto(out *MemberCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberCluster. +func (in *MemberCluster) DeepCopy() *MemberCluster { + if in == nil { + return nil + } + out := new(MemberCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MemberCluster) 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 *MemberClusterList) DeepCopyInto(out *MemberClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MemberCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberClusterList. +func (in *MemberClusterList) DeepCopy() *MemberClusterList { + if in == nil { + return nil + } + out := new(MemberClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MemberClusterList) 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 *MemberClusterSpec) DeepCopyInto(out *MemberClusterSpec) { + *out = *in + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + *out = new(LocalSecretReference) + **out = **in + } + if in.Taints != nil { + in, out := &in.Taints, &out.Taints + *out = make([]v1.Taint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberClusterSpec. +func (in *MemberClusterSpec) DeepCopy() *MemberClusterSpec { + if in == nil { + return nil + } + out := new(MemberClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MemberClusterStatus) DeepCopyInto(out *MemberClusterStatus) { + *out = *in + if in.APIEnablement != nil { + in, out := &in.APIEnablement, &out.APIEnablement + *out = make([]schema.GroupVersionKind, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.NodeSummary.DeepCopyInto(&out.NodeSummary) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberClusterStatus. +func (in *MemberClusterStatus) DeepCopy() *MemberClusterStatus { + if in == nil { + return nil + } + out := new(MemberClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSummary) DeepCopyInto(out *NodeSummary) { + *out = *in + if in.Allocatable != nil { + in, out := &in.Allocatable, &out.Allocatable + *out = make(v1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.Used != nil { + in, out := &in.Used, &out.Used + *out = make(v1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSummary. +func (in *NodeSummary) DeepCopy() *NodeSummary { + if in == nil { + return nil + } + out := new(NodeSummary) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/propagationstrategy/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/propagationstrategy/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..a9e3935ae --- /dev/null +++ b/pkg/apis/propagationstrategy/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,397 @@ +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AggregatedStatusItem) DeepCopyInto(out *AggregatedStatusItem) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregatedStatusItem. +func (in *AggregatedStatusItem) DeepCopy() *AggregatedStatusItem { + if in == nil { + return nil + } + out := new(AggregatedStatusItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentStatus. +func (in *DeploymentStatus) DeepCopy() *DeploymentStatus { + if in == nil { + return nil + } + out := new(DeploymentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Manifest) DeepCopyInto(out *Manifest) { + *out = *in + in.RawExtension.DeepCopyInto(&out.RawExtension) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Manifest. +func (in *Manifest) DeepCopy() *Manifest { + if in == nil { + return nil + } + out := new(Manifest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestCondition) DeepCopyInto(out *ManifestCondition) { + *out = *in + out.Identifier = in.Identifier + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestCondition. +func (in *ManifestCondition) DeepCopy() *ManifestCondition { + if in == nil { + return nil + } + out := new(ManifestCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectReference) DeepCopyInto(out *ObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference. +func (in *ObjectReference) DeepCopy() *ObjectReference { + if in == nil { + return nil + } + out := new(ObjectReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PropagationBinding) DeepCopyInto(out *PropagationBinding) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationBinding. +func (in *PropagationBinding) DeepCopy() *PropagationBinding { + if in == nil { + return nil + } + out := new(PropagationBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PropagationBinding) 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 *PropagationBindingList) DeepCopyInto(out *PropagationBindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PropagationBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationBindingList. +func (in *PropagationBindingList) DeepCopy() *PropagationBindingList { + if in == nil { + return nil + } + out := new(PropagationBindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PropagationBindingList) 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 *PropagationBindingSpec) DeepCopyInto(out *PropagationBindingSpec) { + *out = *in + out.Resource = in.Resource + if in.Clusters != nil { + in, out := &in.Clusters, &out.Clusters + *out = make([]TargetCluster, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationBindingSpec. +func (in *PropagationBindingSpec) DeepCopy() *PropagationBindingSpec { + if in == nil { + return nil + } + out := new(PropagationBindingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PropagationBindingStatus) DeepCopyInto(out *PropagationBindingStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AggregatedStatus != nil { + in, out := &in.AggregatedStatus, &out.AggregatedStatus + *out = make([]AggregatedStatusItem, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationBindingStatus. +func (in *PropagationBindingStatus) DeepCopy() *PropagationBindingStatus { + if in == nil { + return nil + } + out := new(PropagationBindingStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PropagationWork) DeepCopyInto(out *PropagationWork) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationWork. +func (in *PropagationWork) DeepCopy() *PropagationWork { + if in == nil { + return nil + } + out := new(PropagationWork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PropagationWork) 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 *PropagationWorkList) DeepCopyInto(out *PropagationWorkList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PropagationWork, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationWorkList. +func (in *PropagationWorkList) DeepCopy() *PropagationWorkList { + if in == nil { + return nil + } + out := new(PropagationWorkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PropagationWorkList) 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 *PropagationWorkSpec) DeepCopyInto(out *PropagationWorkSpec) { + *out = *in + in.Workload.DeepCopyInto(&out.Workload) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationWorkSpec. +func (in *PropagationWorkSpec) DeepCopy() *PropagationWorkSpec { + if in == nil { + return nil + } + out := new(PropagationWorkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PropagationWorkStatus) DeepCopyInto(out *PropagationWorkStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ManifestConditions != nil { + in, out := &in.ManifestConditions, &out.ManifestConditions + *out = make([]ManifestCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropagationWorkStatus. +func (in *PropagationWorkStatus) DeepCopy() *PropagationWorkStatus { + if in == nil { + return nil + } + out := new(PropagationWorkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceIdentifier) DeepCopyInto(out *ResourceIdentifier) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceIdentifier. +func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier { + if in == nil { + return nil + } + out := new(ResourceIdentifier) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus) { + *out = *in + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(DeploymentStatus) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus. +func (in *ResourceStatus) DeepCopy() *ResourceStatus { + if in == nil { + return nil + } + out := new(ResourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetCluster) DeepCopyInto(out *TargetCluster) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetCluster. +func (in *TargetCluster) DeepCopy() *TargetCluster { + if in == nil { + return nil + } + out := new(TargetCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadTemplate) DeepCopyInto(out *WorkloadTemplate) { + *out = *in + if in.Manifests != nil { + in, out := &in.Manifests, &out.Manifests + *out = make([]Manifest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadTemplate. +func (in *WorkloadTemplate) DeepCopy() *WorkloadTemplate { + if in == nil { + return nil + } + out := new(WorkloadTemplate) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go new file mode 100644 index 000000000..e08a60032 --- /dev/null +++ b/pkg/generated/clientset/versioned/clientset.go @@ -0,0 +1,95 @@ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + memberclusterv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1" + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + MemberclusterV1alpha1() memberclusterv1alpha1.MemberclusterV1alpha1Interface + PropagationstrategyV1alpha1() propagationstrategyv1alpha1.PropagationstrategyV1alpha1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + memberclusterV1alpha1 *memberclusterv1alpha1.MemberclusterV1alpha1Client + propagationstrategyV1alpha1 *propagationstrategyv1alpha1.PropagationstrategyV1alpha1Client +} + +// MemberclusterV1alpha1 retrieves the MemberclusterV1alpha1Client +func (c *Clientset) MemberclusterV1alpha1() memberclusterv1alpha1.MemberclusterV1alpha1Interface { + return c.memberclusterV1alpha1 +} + +// PropagationstrategyV1alpha1 retrieves the PropagationstrategyV1alpha1Client +func (c *Clientset) PropagationstrategyV1alpha1() propagationstrategyv1alpha1.PropagationstrategyV1alpha1Interface { + return c.propagationstrategyV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.memberclusterV1alpha1, err = memberclusterv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.propagationstrategyV1alpha1, err = propagationstrategyv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.memberclusterV1alpha1 = memberclusterv1alpha1.NewForConfigOrDie(c) + cs.propagationstrategyV1alpha1 = propagationstrategyv1alpha1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.memberclusterV1alpha1 = memberclusterv1alpha1.New(c) + cs.propagationstrategyV1alpha1 = propagationstrategyv1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/generated/clientset/versioned/doc.go b/pkg/generated/clientset/versioned/doc.go new file mode 100644 index 000000000..0e0c2a890 --- /dev/null +++ b/pkg/generated/clientset/versioned/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 000000000..2a58ab2fb --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,73 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned" + memberclusterv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1" + fakememberclusterv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake" + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1" + fakepropagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// MemberclusterV1alpha1 retrieves the MemberclusterV1alpha1Client +func (c *Clientset) MemberclusterV1alpha1() memberclusterv1alpha1.MemberclusterV1alpha1Interface { + return &fakememberclusterv1alpha1.FakeMemberclusterV1alpha1{Fake: &c.Fake} +} + +// PropagationstrategyV1alpha1 retrieves the PropagationstrategyV1alpha1Client +func (c *Clientset) PropagationstrategyV1alpha1() propagationstrategyv1alpha1.PropagationstrategyV1alpha1Interface { + return &fakepropagationstrategyv1alpha1.FakePropagationstrategyV1alpha1{Fake: &c.Fake} +} diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go new file mode 100644 index 000000000..3630ed1cd --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go new file mode 100644 index 000000000..ad54650d8 --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -0,0 +1,42 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + memberclusterv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + memberclusterv1alpha1.AddToScheme, + propagationstrategyv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 000000000..14db57a58 --- /dev/null +++ b/pkg/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go new file mode 100644 index 000000000..234ce81b6 --- /dev/null +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -0,0 +1,42 @@ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + memberclusterv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + memberclusterv1alpha1.AddToScheme, + propagationstrategyv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/doc.go new file mode 100644 index 000000000..93a7ca4e0 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/doc.go new file mode 100644 index 000000000..2b5ba4c8e --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster.go new file mode 100644 index 000000000..c609795ac --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster.go @@ -0,0 +1,126 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeMemberClusters implements MemberClusterInterface +type FakeMemberClusters struct { + Fake *FakeMemberclusterV1alpha1 + ns string +} + +var memberclustersResource = schema.GroupVersionResource{Group: "membercluster.karmada.io", Version: "v1alpha1", Resource: "memberclusters"} + +var memberclustersKind = schema.GroupVersionKind{Group: "membercluster.karmada.io", Version: "v1alpha1", Kind: "MemberCluster"} + +// Get takes name of the memberCluster, and returns the corresponding memberCluster object, and an error if there is any. +func (c *FakeMemberClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MemberCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(memberclustersResource, c.ns, name), &v1alpha1.MemberCluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MemberCluster), err +} + +// List takes label and field selectors, and returns the list of MemberClusters that match those selectors. +func (c *FakeMemberClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MemberClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(memberclustersResource, memberclustersKind, c.ns, opts), &v1alpha1.MemberClusterList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.MemberClusterList{ListMeta: obj.(*v1alpha1.MemberClusterList).ListMeta} + for _, item := range obj.(*v1alpha1.MemberClusterList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested memberClusters. +func (c *FakeMemberClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(memberclustersResource, c.ns, opts)) + +} + +// Create takes the representation of a memberCluster and creates it. Returns the server's representation of the memberCluster, and an error, if there is any. +func (c *FakeMemberClusters) Create(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.CreateOptions) (result *v1alpha1.MemberCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(memberclustersResource, c.ns, memberCluster), &v1alpha1.MemberCluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MemberCluster), err +} + +// Update takes the representation of a memberCluster and updates it. Returns the server's representation of the memberCluster, and an error, if there is any. +func (c *FakeMemberClusters) Update(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.UpdateOptions) (result *v1alpha1.MemberCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(memberclustersResource, c.ns, memberCluster), &v1alpha1.MemberCluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MemberCluster), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeMemberClusters) UpdateStatus(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.UpdateOptions) (*v1alpha1.MemberCluster, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(memberclustersResource, "status", c.ns, memberCluster), &v1alpha1.MemberCluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MemberCluster), err +} + +// Delete takes name of the memberCluster and deletes it. Returns an error if one occurs. +func (c *FakeMemberClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(memberclustersResource, c.ns, name), &v1alpha1.MemberCluster{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMemberClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(memberclustersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.MemberClusterList{}) + return err +} + +// Patch applies the patch and returns the patched memberCluster. +func (c *FakeMemberClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MemberCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(memberclustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.MemberCluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MemberCluster), err +} diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster_client.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster_client.go new file mode 100644 index 000000000..e19fa1f9f --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/fake/fake_membercluster_client.go @@ -0,0 +1,24 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeMemberclusterV1alpha1 struct { + *testing.Fake +} + +func (c *FakeMemberclusterV1alpha1) MemberClusters(namespace string) v1alpha1.MemberClusterInterface { + return &FakeMemberClusters{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeMemberclusterV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..3a3c440c5 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/generated_expansion.go @@ -0,0 +1,5 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type MemberClusterExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster.go new file mode 100644 index 000000000..c87b21793 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster.go @@ -0,0 +1,179 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + scheme "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MemberClustersGetter has a method to return a MemberClusterInterface. +// A group's client should implement this interface. +type MemberClustersGetter interface { + MemberClusters(namespace string) MemberClusterInterface +} + +// MemberClusterInterface has methods to work with MemberCluster resources. +type MemberClusterInterface interface { + Create(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.CreateOptions) (*v1alpha1.MemberCluster, error) + Update(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.UpdateOptions) (*v1alpha1.MemberCluster, error) + UpdateStatus(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.UpdateOptions) (*v1alpha1.MemberCluster, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.MemberCluster, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.MemberClusterList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MemberCluster, err error) + MemberClusterExpansion +} + +// memberClusters implements MemberClusterInterface +type memberClusters struct { + client rest.Interface + ns string +} + +// newMemberClusters returns a MemberClusters +func newMemberClusters(c *MemberclusterV1alpha1Client, namespace string) *memberClusters { + return &memberClusters{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the memberCluster, and returns the corresponding memberCluster object, and an error if there is any. +func (c *memberClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MemberCluster, err error) { + result = &v1alpha1.MemberCluster{} + err = c.client.Get(). + Namespace(c.ns). + Resource("memberclusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MemberClusters that match those selectors. +func (c *memberClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MemberClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.MemberClusterList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("memberclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested memberClusters. +func (c *memberClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("memberclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a memberCluster and creates it. Returns the server's representation of the memberCluster, and an error, if there is any. +func (c *memberClusters) Create(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.CreateOptions) (result *v1alpha1.MemberCluster, err error) { + result = &v1alpha1.MemberCluster{} + err = c.client.Post(). + Namespace(c.ns). + Resource("memberclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(memberCluster). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a memberCluster and updates it. Returns the server's representation of the memberCluster, and an error, if there is any. +func (c *memberClusters) Update(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.UpdateOptions) (result *v1alpha1.MemberCluster, err error) { + result = &v1alpha1.MemberCluster{} + err = c.client.Put(). + Namespace(c.ns). + Resource("memberclusters"). + Name(memberCluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(memberCluster). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *memberClusters) UpdateStatus(ctx context.Context, memberCluster *v1alpha1.MemberCluster, opts v1.UpdateOptions) (result *v1alpha1.MemberCluster, err error) { + result = &v1alpha1.MemberCluster{} + err = c.client.Put(). + Namespace(c.ns). + Resource("memberclusters"). + Name(memberCluster.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(memberCluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the memberCluster and deletes it. Returns an error if one occurs. +func (c *memberClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("memberclusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *memberClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("memberclusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched memberCluster. +func (c *memberClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MemberCluster, err error) { + result = &v1alpha1.MemberCluster{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("memberclusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster_client.go b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster_client.go new file mode 100644 index 000000000..d2f02e6fe --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/membercluster/v1alpha1/membercluster_client.go @@ -0,0 +1,73 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type MemberclusterV1alpha1Interface interface { + RESTClient() rest.Interface + MemberClustersGetter +} + +// MemberclusterV1alpha1Client is used to interact with features provided by the membercluster.karmada.io group. +type MemberclusterV1alpha1Client struct { + restClient rest.Interface +} + +func (c *MemberclusterV1alpha1Client) MemberClusters(namespace string) MemberClusterInterface { + return newMemberClusters(c, namespace) +} + +// NewForConfig creates a new MemberclusterV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*MemberclusterV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &MemberclusterV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new MemberclusterV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MemberclusterV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MemberclusterV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *MemberclusterV1alpha1Client { + return &MemberclusterV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *MemberclusterV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/doc.go new file mode 100644 index 000000000..93a7ca4e0 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/doc.go new file mode 100644 index 000000000..2b5ba4c8e --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationbinding.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationbinding.go new file mode 100644 index 000000000..2dd1b17f9 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationbinding.go @@ -0,0 +1,126 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePropagationBindings implements PropagationBindingInterface +type FakePropagationBindings struct { + Fake *FakePropagationstrategyV1alpha1 + ns string +} + +var propagationbindingsResource = schema.GroupVersionResource{Group: "propagationstrategy.karmada.io", Version: "v1alpha1", Resource: "propagationbindings"} + +var propagationbindingsKind = schema.GroupVersionKind{Group: "propagationstrategy.karmada.io", Version: "v1alpha1", Kind: "PropagationBinding"} + +// Get takes name of the propagationBinding, and returns the corresponding propagationBinding object, and an error if there is any. +func (c *FakePropagationBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PropagationBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(propagationbindingsResource, c.ns, name), &v1alpha1.PropagationBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationBinding), err +} + +// List takes label and field selectors, and returns the list of PropagationBindings that match those selectors. +func (c *FakePropagationBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PropagationBindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(propagationbindingsResource, propagationbindingsKind, c.ns, opts), &v1alpha1.PropagationBindingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.PropagationBindingList{ListMeta: obj.(*v1alpha1.PropagationBindingList).ListMeta} + for _, item := range obj.(*v1alpha1.PropagationBindingList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested propagationBindings. +func (c *FakePropagationBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(propagationbindingsResource, c.ns, opts)) + +} + +// Create takes the representation of a propagationBinding and creates it. Returns the server's representation of the propagationBinding, and an error, if there is any. +func (c *FakePropagationBindings) Create(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.CreateOptions) (result *v1alpha1.PropagationBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(propagationbindingsResource, c.ns, propagationBinding), &v1alpha1.PropagationBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationBinding), err +} + +// Update takes the representation of a propagationBinding and updates it. Returns the server's representation of the propagationBinding, and an error, if there is any. +func (c *FakePropagationBindings) Update(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.UpdateOptions) (result *v1alpha1.PropagationBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(propagationbindingsResource, c.ns, propagationBinding), &v1alpha1.PropagationBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationBinding), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePropagationBindings) UpdateStatus(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.UpdateOptions) (*v1alpha1.PropagationBinding, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(propagationbindingsResource, "status", c.ns, propagationBinding), &v1alpha1.PropagationBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationBinding), err +} + +// Delete takes name of the propagationBinding and deletes it. Returns an error if one occurs. +func (c *FakePropagationBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(propagationbindingsResource, c.ns, name), &v1alpha1.PropagationBinding{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePropagationBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(propagationbindingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.PropagationBindingList{}) + return err +} + +// Patch applies the patch and returns the patched propagationBinding. +func (c *FakePropagationBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PropagationBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(propagationbindingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.PropagationBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationBinding), err +} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationstrategy_client.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationstrategy_client.go new file mode 100644 index 000000000..68bfbd3ae --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationstrategy_client.go @@ -0,0 +1,28 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakePropagationstrategyV1alpha1 struct { + *testing.Fake +} + +func (c *FakePropagationstrategyV1alpha1) PropagationBindings(namespace string) v1alpha1.PropagationBindingInterface { + return &FakePropagationBindings{c, namespace} +} + +func (c *FakePropagationstrategyV1alpha1) PropagationWorks(namespace string) v1alpha1.PropagationWorkInterface { + return &FakePropagationWorks{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakePropagationstrategyV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationwork.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationwork.go new file mode 100644 index 000000000..c571cdcfc --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/fake/fake_propagationwork.go @@ -0,0 +1,126 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePropagationWorks implements PropagationWorkInterface +type FakePropagationWorks struct { + Fake *FakePropagationstrategyV1alpha1 + ns string +} + +var propagationworksResource = schema.GroupVersionResource{Group: "propagationstrategy.karmada.io", Version: "v1alpha1", Resource: "propagationworks"} + +var propagationworksKind = schema.GroupVersionKind{Group: "propagationstrategy.karmada.io", Version: "v1alpha1", Kind: "PropagationWork"} + +// Get takes name of the propagationWork, and returns the corresponding propagationWork object, and an error if there is any. +func (c *FakePropagationWorks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PropagationWork, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(propagationworksResource, c.ns, name), &v1alpha1.PropagationWork{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationWork), err +} + +// List takes label and field selectors, and returns the list of PropagationWorks that match those selectors. +func (c *FakePropagationWorks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PropagationWorkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(propagationworksResource, propagationworksKind, c.ns, opts), &v1alpha1.PropagationWorkList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.PropagationWorkList{ListMeta: obj.(*v1alpha1.PropagationWorkList).ListMeta} + for _, item := range obj.(*v1alpha1.PropagationWorkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested propagationWorks. +func (c *FakePropagationWorks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(propagationworksResource, c.ns, opts)) + +} + +// Create takes the representation of a propagationWork and creates it. Returns the server's representation of the propagationWork, and an error, if there is any. +func (c *FakePropagationWorks) Create(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.CreateOptions) (result *v1alpha1.PropagationWork, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(propagationworksResource, c.ns, propagationWork), &v1alpha1.PropagationWork{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationWork), err +} + +// Update takes the representation of a propagationWork and updates it. Returns the server's representation of the propagationWork, and an error, if there is any. +func (c *FakePropagationWorks) Update(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.UpdateOptions) (result *v1alpha1.PropagationWork, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(propagationworksResource, c.ns, propagationWork), &v1alpha1.PropagationWork{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationWork), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePropagationWorks) UpdateStatus(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.UpdateOptions) (*v1alpha1.PropagationWork, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(propagationworksResource, "status", c.ns, propagationWork), &v1alpha1.PropagationWork{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationWork), err +} + +// Delete takes name of the propagationWork and deletes it. Returns an error if one occurs. +func (c *FakePropagationWorks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(propagationworksResource, c.ns, name), &v1alpha1.PropagationWork{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePropagationWorks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(propagationworksResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.PropagationWorkList{}) + return err +} + +// Patch applies the patch and returns the patched propagationWork. +func (c *FakePropagationWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PropagationWork, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(propagationworksResource, c.ns, name, pt, data, subresources...), &v1alpha1.PropagationWork{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PropagationWork), err +} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..c7186af0b --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/generated_expansion.go @@ -0,0 +1,7 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type PropagationBindingExpansion interface{} + +type PropagationWorkExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationbinding.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationbinding.go new file mode 100644 index 000000000..abd83d198 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationbinding.go @@ -0,0 +1,179 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + scheme "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// PropagationBindingsGetter has a method to return a PropagationBindingInterface. +// A group's client should implement this interface. +type PropagationBindingsGetter interface { + PropagationBindings(namespace string) PropagationBindingInterface +} + +// PropagationBindingInterface has methods to work with PropagationBinding resources. +type PropagationBindingInterface interface { + Create(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.CreateOptions) (*v1alpha1.PropagationBinding, error) + Update(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.UpdateOptions) (*v1alpha1.PropagationBinding, error) + UpdateStatus(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.UpdateOptions) (*v1alpha1.PropagationBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PropagationBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PropagationBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PropagationBinding, err error) + PropagationBindingExpansion +} + +// propagationBindings implements PropagationBindingInterface +type propagationBindings struct { + client rest.Interface + ns string +} + +// newPropagationBindings returns a PropagationBindings +func newPropagationBindings(c *PropagationstrategyV1alpha1Client, namespace string) *propagationBindings { + return &propagationBindings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the propagationBinding, and returns the corresponding propagationBinding object, and an error if there is any. +func (c *propagationBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PropagationBinding, err error) { + result = &v1alpha1.PropagationBinding{} + err = c.client.Get(). + Namespace(c.ns). + Resource("propagationbindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PropagationBindings that match those selectors. +func (c *propagationBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PropagationBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PropagationBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("propagationbindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested propagationBindings. +func (c *propagationBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("propagationbindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a propagationBinding and creates it. Returns the server's representation of the propagationBinding, and an error, if there is any. +func (c *propagationBindings) Create(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.CreateOptions) (result *v1alpha1.PropagationBinding, err error) { + result = &v1alpha1.PropagationBinding{} + err = c.client.Post(). + Namespace(c.ns). + Resource("propagationbindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(propagationBinding). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a propagationBinding and updates it. Returns the server's representation of the propagationBinding, and an error, if there is any. +func (c *propagationBindings) Update(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.UpdateOptions) (result *v1alpha1.PropagationBinding, err error) { + result = &v1alpha1.PropagationBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("propagationbindings"). + Name(propagationBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(propagationBinding). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *propagationBindings) UpdateStatus(ctx context.Context, propagationBinding *v1alpha1.PropagationBinding, opts v1.UpdateOptions) (result *v1alpha1.PropagationBinding, err error) { + result = &v1alpha1.PropagationBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("propagationbindings"). + Name(propagationBinding.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(propagationBinding). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the propagationBinding and deletes it. Returns an error if one occurs. +func (c *propagationBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("propagationbindings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *propagationBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("propagationbindings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched propagationBinding. +func (c *propagationBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PropagationBinding, err error) { + result = &v1alpha1.PropagationBinding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("propagationbindings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationstrategy_client.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationstrategy_client.go new file mode 100644 index 000000000..d14be8c5c --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationstrategy_client.go @@ -0,0 +1,78 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type PropagationstrategyV1alpha1Interface interface { + RESTClient() rest.Interface + PropagationBindingsGetter + PropagationWorksGetter +} + +// PropagationstrategyV1alpha1Client is used to interact with features provided by the propagationstrategy.karmada.io group. +type PropagationstrategyV1alpha1Client struct { + restClient rest.Interface +} + +func (c *PropagationstrategyV1alpha1Client) PropagationBindings(namespace string) PropagationBindingInterface { + return newPropagationBindings(c, namespace) +} + +func (c *PropagationstrategyV1alpha1Client) PropagationWorks(namespace string) PropagationWorkInterface { + return newPropagationWorks(c, namespace) +} + +// NewForConfig creates a new PropagationstrategyV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*PropagationstrategyV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &PropagationstrategyV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new PropagationstrategyV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *PropagationstrategyV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new PropagationstrategyV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *PropagationstrategyV1alpha1Client { + return &PropagationstrategyV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *PropagationstrategyV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationwork.go b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationwork.go new file mode 100644 index 000000000..fb54d7c3b --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/propagationstrategy/v1alpha1/propagationwork.go @@ -0,0 +1,179 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + scheme "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// PropagationWorksGetter has a method to return a PropagationWorkInterface. +// A group's client should implement this interface. +type PropagationWorksGetter interface { + PropagationWorks(namespace string) PropagationWorkInterface +} + +// PropagationWorkInterface has methods to work with PropagationWork resources. +type PropagationWorkInterface interface { + Create(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.CreateOptions) (*v1alpha1.PropagationWork, error) + Update(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.UpdateOptions) (*v1alpha1.PropagationWork, error) + UpdateStatus(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.UpdateOptions) (*v1alpha1.PropagationWork, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PropagationWork, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PropagationWorkList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PropagationWork, err error) + PropagationWorkExpansion +} + +// propagationWorks implements PropagationWorkInterface +type propagationWorks struct { + client rest.Interface + ns string +} + +// newPropagationWorks returns a PropagationWorks +func newPropagationWorks(c *PropagationstrategyV1alpha1Client, namespace string) *propagationWorks { + return &propagationWorks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the propagationWork, and returns the corresponding propagationWork object, and an error if there is any. +func (c *propagationWorks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PropagationWork, err error) { + result = &v1alpha1.PropagationWork{} + err = c.client.Get(). + Namespace(c.ns). + Resource("propagationworks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PropagationWorks that match those selectors. +func (c *propagationWorks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PropagationWorkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PropagationWorkList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("propagationworks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested propagationWorks. +func (c *propagationWorks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("propagationworks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a propagationWork and creates it. Returns the server's representation of the propagationWork, and an error, if there is any. +func (c *propagationWorks) Create(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.CreateOptions) (result *v1alpha1.PropagationWork, err error) { + result = &v1alpha1.PropagationWork{} + err = c.client.Post(). + Namespace(c.ns). + Resource("propagationworks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(propagationWork). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a propagationWork and updates it. Returns the server's representation of the propagationWork, and an error, if there is any. +func (c *propagationWorks) Update(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.UpdateOptions) (result *v1alpha1.PropagationWork, err error) { + result = &v1alpha1.PropagationWork{} + err = c.client.Put(). + Namespace(c.ns). + Resource("propagationworks"). + Name(propagationWork.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(propagationWork). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *propagationWorks) UpdateStatus(ctx context.Context, propagationWork *v1alpha1.PropagationWork, opts v1.UpdateOptions) (result *v1alpha1.PropagationWork, err error) { + result = &v1alpha1.PropagationWork{} + err = c.client.Put(). + Namespace(c.ns). + Resource("propagationworks"). + Name(propagationWork.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(propagationWork). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the propagationWork and deletes it. Returns an error if one occurs. +func (c *propagationWorks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("propagationworks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *propagationWorks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("propagationworks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched propagationWork. +func (c *propagationWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PropagationWork, err error) { + result = &v1alpha1.PropagationWork{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("propagationworks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go new file mode 100644 index 000000000..ca19dbe86 --- /dev/null +++ b/pkg/generated/informers/externalversions/factory.go @@ -0,0 +1,170 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned" + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" + membercluster "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/membercluster" + propagationstrategy "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/propagationstrategy" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Membercluster() membercluster.Interface + Propagationstrategy() propagationstrategy.Interface +} + +func (f *sharedInformerFactory) Membercluster() membercluster.Interface { + return membercluster.New(f, f.namespace, f.tweakListOptions) +} + +func (f *sharedInformerFactory) Propagationstrategy() propagationstrategy.Interface { + return propagationstrategy.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go new file mode 100644 index 000000000..5f5e8a27d --- /dev/null +++ b/pkg/generated/informers/externalversions/generic.go @@ -0,0 +1,53 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=membercluster.karmada.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("memberclusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Membercluster().V1alpha1().MemberClusters().Informer()}, nil + + // Group=propagationstrategy.karmada.io, Version=v1alpha1 + case propagationstrategyv1alpha1.SchemeGroupVersion.WithResource("propagationbindings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Propagationstrategy().V1alpha1().PropagationBindings().Informer()}, nil + case propagationstrategyv1alpha1.SchemeGroupVersion.WithResource("propagationworks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Propagationstrategy().V1alpha1().PropagationWorks().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 000000000..11c91a00e --- /dev/null +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,24 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/generated/informers/externalversions/membercluster/interface.go b/pkg/generated/informers/externalversions/membercluster/interface.go new file mode 100644 index 000000000..2758c73ae --- /dev/null +++ b/pkg/generated/informers/externalversions/membercluster/interface.go @@ -0,0 +1,30 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package membercluster + +import ( + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/membercluster/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/generated/informers/externalversions/membercluster/v1alpha1/interface.go b/pkg/generated/informers/externalversions/membercluster/v1alpha1/interface.go new file mode 100644 index 000000000..958e48393 --- /dev/null +++ b/pkg/generated/informers/externalversions/membercluster/v1alpha1/interface.go @@ -0,0 +1,29 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // MemberClusters returns a MemberClusterInformer. + MemberClusters() MemberClusterInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// MemberClusters returns a MemberClusterInformer. +func (v *version) MemberClusters() MemberClusterInformer { + return &memberClusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/informers/externalversions/membercluster/v1alpha1/membercluster.go b/pkg/generated/informers/externalversions/membercluster/v1alpha1/membercluster.go new file mode 100644 index 000000000..342bb3bbe --- /dev/null +++ b/pkg/generated/informers/externalversions/membercluster/v1alpha1/membercluster.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + memberclusterv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + versioned "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned" + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/listers/membercluster/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MemberClusterInformer provides access to a shared informer and lister for +// MemberClusters. +type MemberClusterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.MemberClusterLister +} + +type memberClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMemberClusterInformer constructs a new informer for MemberCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMemberClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMemberClusterInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMemberClusterInformer constructs a new informer for MemberCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMemberClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MemberclusterV1alpha1().MemberClusters(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MemberclusterV1alpha1().MemberClusters(namespace).Watch(context.TODO(), options) + }, + }, + &memberclusterv1alpha1.MemberCluster{}, + resyncPeriod, + indexers, + ) +} + +func (f *memberClusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMemberClusterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *memberClusterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&memberclusterv1alpha1.MemberCluster{}, f.defaultInformer) +} + +func (f *memberClusterInformer) Lister() v1alpha1.MemberClusterLister { + return v1alpha1.NewMemberClusterLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/propagationstrategy/interface.go b/pkg/generated/informers/externalversions/propagationstrategy/interface.go new file mode 100644 index 000000000..a4f6b9fcc --- /dev/null +++ b/pkg/generated/informers/externalversions/propagationstrategy/interface.go @@ -0,0 +1,30 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package propagationstrategy + +import ( + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/interface.go b/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/interface.go new file mode 100644 index 000000000..d59c083fe --- /dev/null +++ b/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/interface.go @@ -0,0 +1,36 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // PropagationBindings returns a PropagationBindingInformer. + PropagationBindings() PropagationBindingInformer + // PropagationWorks returns a PropagationWorkInformer. + PropagationWorks() PropagationWorkInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// PropagationBindings returns a PropagationBindingInformer. +func (v *version) PropagationBindings() PropagationBindingInformer { + return &propagationBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// PropagationWorks returns a PropagationWorkInformer. +func (v *version) PropagationWorks() PropagationWorkInformer { + return &propagationWorkInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationbinding.go b/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationbinding.go new file mode 100644 index 000000000..9347f4082 --- /dev/null +++ b/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationbinding.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + versioned "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned" + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/listers/propagationstrategy/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PropagationBindingInformer provides access to a shared informer and lister for +// PropagationBindings. +type PropagationBindingInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.PropagationBindingLister +} + +type propagationBindingInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPropagationBindingInformer constructs a new informer for PropagationBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPropagationBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPropagationBindingInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPropagationBindingInformer constructs a new informer for PropagationBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPropagationBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PropagationstrategyV1alpha1().PropagationBindings(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PropagationstrategyV1alpha1().PropagationBindings(namespace).Watch(context.TODO(), options) + }, + }, + &propagationstrategyv1alpha1.PropagationBinding{}, + resyncPeriod, + indexers, + ) +} + +func (f *propagationBindingInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPropagationBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *propagationBindingInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&propagationstrategyv1alpha1.PropagationBinding{}, f.defaultInformer) +} + +func (f *propagationBindingInformer) Lister() v1alpha1.PropagationBindingLister { + return v1alpha1.NewPropagationBindingLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationwork.go b/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationwork.go new file mode 100644 index 000000000..9244c3079 --- /dev/null +++ b/pkg/generated/informers/externalversions/propagationstrategy/v1alpha1/propagationwork.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + propagationstrategyv1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + versioned "github.com/huawei-cloudnative/karmada/pkg/generated/clientset/versioned" + internalinterfaces "github.com/huawei-cloudnative/karmada/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/generated/listers/propagationstrategy/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PropagationWorkInformer provides access to a shared informer and lister for +// PropagationWorks. +type PropagationWorkInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.PropagationWorkLister +} + +type propagationWorkInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPropagationWorkInformer constructs a new informer for PropagationWork type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPropagationWorkInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPropagationWorkInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPropagationWorkInformer constructs a new informer for PropagationWork type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPropagationWorkInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PropagationstrategyV1alpha1().PropagationWorks(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PropagationstrategyV1alpha1().PropagationWorks(namespace).Watch(context.TODO(), options) + }, + }, + &propagationstrategyv1alpha1.PropagationWork{}, + resyncPeriod, + indexers, + ) +} + +func (f *propagationWorkInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPropagationWorkInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *propagationWorkInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&propagationstrategyv1alpha1.PropagationWork{}, f.defaultInformer) +} + +func (f *propagationWorkInformer) Lister() v1alpha1.PropagationWorkLister { + return v1alpha1.NewPropagationWorkLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/listers/membercluster/v1alpha1/expansion_generated.go b/pkg/generated/listers/membercluster/v1alpha1/expansion_generated.go new file mode 100644 index 000000000..6e66c9429 --- /dev/null +++ b/pkg/generated/listers/membercluster/v1alpha1/expansion_generated.go @@ -0,0 +1,11 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// MemberClusterListerExpansion allows custom methods to be added to +// MemberClusterLister. +type MemberClusterListerExpansion interface{} + +// MemberClusterNamespaceListerExpansion allows custom methods to be added to +// MemberClusterNamespaceLister. +type MemberClusterNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/membercluster/v1alpha1/membercluster.go b/pkg/generated/listers/membercluster/v1alpha1/membercluster.go new file mode 100644 index 000000000..ea9bb820b --- /dev/null +++ b/pkg/generated/listers/membercluster/v1alpha1/membercluster.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/membercluster/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MemberClusterLister helps list MemberClusters. +// All objects returned here must be treated as read-only. +type MemberClusterLister interface { + // List lists all MemberClusters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.MemberCluster, err error) + // MemberClusters returns an object that can list and get MemberClusters. + MemberClusters(namespace string) MemberClusterNamespaceLister + MemberClusterListerExpansion +} + +// memberClusterLister implements the MemberClusterLister interface. +type memberClusterLister struct { + indexer cache.Indexer +} + +// NewMemberClusterLister returns a new MemberClusterLister. +func NewMemberClusterLister(indexer cache.Indexer) MemberClusterLister { + return &memberClusterLister{indexer: indexer} +} + +// List lists all MemberClusters in the indexer. +func (s *memberClusterLister) List(selector labels.Selector) (ret []*v1alpha1.MemberCluster, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.MemberCluster)) + }) + return ret, err +} + +// MemberClusters returns an object that can list and get MemberClusters. +func (s *memberClusterLister) MemberClusters(namespace string) MemberClusterNamespaceLister { + return memberClusterNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MemberClusterNamespaceLister helps list and get MemberClusters. +// All objects returned here must be treated as read-only. +type MemberClusterNamespaceLister interface { + // List lists all MemberClusters in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.MemberCluster, err error) + // Get retrieves the MemberCluster from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.MemberCluster, error) + MemberClusterNamespaceListerExpansion +} + +// memberClusterNamespaceLister implements the MemberClusterNamespaceLister +// interface. +type memberClusterNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MemberClusters in the indexer for a given namespace. +func (s memberClusterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MemberCluster, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.MemberCluster)) + }) + return ret, err +} + +// Get retrieves the MemberCluster from the indexer for a given namespace and name. +func (s memberClusterNamespaceLister) Get(name string) (*v1alpha1.MemberCluster, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("membercluster"), name) + } + return obj.(*v1alpha1.MemberCluster), nil +} diff --git a/pkg/generated/listers/propagationstrategy/v1alpha1/expansion_generated.go b/pkg/generated/listers/propagationstrategy/v1alpha1/expansion_generated.go new file mode 100644 index 000000000..9d876d4a3 --- /dev/null +++ b/pkg/generated/listers/propagationstrategy/v1alpha1/expansion_generated.go @@ -0,0 +1,19 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// PropagationBindingListerExpansion allows custom methods to be added to +// PropagationBindingLister. +type PropagationBindingListerExpansion interface{} + +// PropagationBindingNamespaceListerExpansion allows custom methods to be added to +// PropagationBindingNamespaceLister. +type PropagationBindingNamespaceListerExpansion interface{} + +// PropagationWorkListerExpansion allows custom methods to be added to +// PropagationWorkLister. +type PropagationWorkListerExpansion interface{} + +// PropagationWorkNamespaceListerExpansion allows custom methods to be added to +// PropagationWorkNamespaceLister. +type PropagationWorkNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/propagationstrategy/v1alpha1/propagationbinding.go b/pkg/generated/listers/propagationstrategy/v1alpha1/propagationbinding.go new file mode 100644 index 000000000..0b10f2e6b --- /dev/null +++ b/pkg/generated/listers/propagationstrategy/v1alpha1/propagationbinding.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PropagationBindingLister helps list PropagationBindings. +// All objects returned here must be treated as read-only. +type PropagationBindingLister interface { + // List lists all PropagationBindings in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.PropagationBinding, err error) + // PropagationBindings returns an object that can list and get PropagationBindings. + PropagationBindings(namespace string) PropagationBindingNamespaceLister + PropagationBindingListerExpansion +} + +// propagationBindingLister implements the PropagationBindingLister interface. +type propagationBindingLister struct { + indexer cache.Indexer +} + +// NewPropagationBindingLister returns a new PropagationBindingLister. +func NewPropagationBindingLister(indexer cache.Indexer) PropagationBindingLister { + return &propagationBindingLister{indexer: indexer} +} + +// List lists all PropagationBindings in the indexer. +func (s *propagationBindingLister) List(selector labels.Selector) (ret []*v1alpha1.PropagationBinding, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.PropagationBinding)) + }) + return ret, err +} + +// PropagationBindings returns an object that can list and get PropagationBindings. +func (s *propagationBindingLister) PropagationBindings(namespace string) PropagationBindingNamespaceLister { + return propagationBindingNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PropagationBindingNamespaceLister helps list and get PropagationBindings. +// All objects returned here must be treated as read-only. +type PropagationBindingNamespaceLister interface { + // List lists all PropagationBindings in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.PropagationBinding, err error) + // Get retrieves the PropagationBinding from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.PropagationBinding, error) + PropagationBindingNamespaceListerExpansion +} + +// propagationBindingNamespaceLister implements the PropagationBindingNamespaceLister +// interface. +type propagationBindingNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all PropagationBindings in the indexer for a given namespace. +func (s propagationBindingNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PropagationBinding, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.PropagationBinding)) + }) + return ret, err +} + +// Get retrieves the PropagationBinding from the indexer for a given namespace and name. +func (s propagationBindingNamespaceLister) Get(name string) (*v1alpha1.PropagationBinding, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("propagationbinding"), name) + } + return obj.(*v1alpha1.PropagationBinding), nil +} diff --git a/pkg/generated/listers/propagationstrategy/v1alpha1/propagationwork.go b/pkg/generated/listers/propagationstrategy/v1alpha1/propagationwork.go new file mode 100644 index 000000000..ee0a2f1bf --- /dev/null +++ b/pkg/generated/listers/propagationstrategy/v1alpha1/propagationwork.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/huawei-cloudnative/karmada/pkg/apis/propagationstrategy/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PropagationWorkLister helps list PropagationWorks. +// All objects returned here must be treated as read-only. +type PropagationWorkLister interface { + // List lists all PropagationWorks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.PropagationWork, err error) + // PropagationWorks returns an object that can list and get PropagationWorks. + PropagationWorks(namespace string) PropagationWorkNamespaceLister + PropagationWorkListerExpansion +} + +// propagationWorkLister implements the PropagationWorkLister interface. +type propagationWorkLister struct { + indexer cache.Indexer +} + +// NewPropagationWorkLister returns a new PropagationWorkLister. +func NewPropagationWorkLister(indexer cache.Indexer) PropagationWorkLister { + return &propagationWorkLister{indexer: indexer} +} + +// List lists all PropagationWorks in the indexer. +func (s *propagationWorkLister) List(selector labels.Selector) (ret []*v1alpha1.PropagationWork, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.PropagationWork)) + }) + return ret, err +} + +// PropagationWorks returns an object that can list and get PropagationWorks. +func (s *propagationWorkLister) PropagationWorks(namespace string) PropagationWorkNamespaceLister { + return propagationWorkNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PropagationWorkNamespaceLister helps list and get PropagationWorks. +// All objects returned here must be treated as read-only. +type PropagationWorkNamespaceLister interface { + // List lists all PropagationWorks in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.PropagationWork, err error) + // Get retrieves the PropagationWork from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.PropagationWork, error) + PropagationWorkNamespaceListerExpansion +} + +// propagationWorkNamespaceLister implements the PropagationWorkNamespaceLister +// interface. +type propagationWorkNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all PropagationWorks in the indexer for a given namespace. +func (s propagationWorkNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PropagationWork, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.PropagationWork)) + }) + return ret, err +} + +// Get retrieves the PropagationWork from the indexer for a given namespace and name. +func (s propagationWorkNamespaceLister) Get(name string) (*v1alpha1.PropagationWork, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("propagationwork"), name) + } + return obj.(*v1alpha1.PropagationWork), nil +}