From c8078cbaf7d22fa6e37cf19111eab6ad0cde59d8 Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Sat, 6 Mar 2021 14:50:01 +0800 Subject: [PATCH] Autogenerate files Signed-off-by: RainbowMango --- .../work.karmada.io_resourcebindings.yaml | 228 ++++++++++++++++++ .../policy/v1alpha1/zz_generated.deepcopy.go | 199 --------------- .../policy/v1alpha1/zz_generated.register.go | 2 - .../work/v1alpha1/zz_generated.deepcopy.go | 199 +++++++++++++++ .../work/v1alpha1/zz_generated.register.go | 2 + .../v1alpha1/fake/fake_policy_client.go | 4 - .../policy/v1alpha1/generated_expansion.go | 2 - .../typed/policy/v1alpha1/policy_client.go | 5 - .../v1alpha1/fake/fake_resourcebinding.go | 8 +- .../work/v1alpha1/fake/fake_work_client.go | 4 + .../work/v1alpha1/generated_expansion.go | 2 + .../v1alpha1/resourcebinding.go | 4 +- .../typed/work/v1alpha1/work_client.go | 5 + .../informers/externalversions/generic.go | 4 +- .../policy/v1alpha1/interface.go | 7 - .../work/v1alpha1/interface.go | 7 + .../v1alpha1/resourcebinding.go | 12 +- .../policy/v1alpha1/expansion_generated.go | 8 - .../work/v1alpha1/expansion_generated.go | 8 + .../v1alpha1/resourcebinding.go | 2 +- 20 files changed, 470 insertions(+), 242 deletions(-) create mode 100644 artifacts/deploy/work.karmada.io_resourcebindings.yaml rename pkg/generated/clientset/versioned/typed/{policy => work}/v1alpha1/fake/fake_resourcebinding.go (94%) rename pkg/generated/clientset/versioned/typed/{policy => work}/v1alpha1/resourcebinding.go (97%) rename pkg/generated/informers/externalversions/{policy => work}/v1alpha1/resourcebinding.go (85%) rename pkg/generated/listers/{policy => work}/v1alpha1/resourcebinding.go (97%) diff --git a/artifacts/deploy/work.karmada.io_resourcebindings.yaml b/artifacts/deploy/work.karmada.io_resourcebindings.yaml new file mode 100644 index 000000000..c8742c6fe --- /dev/null +++ b/artifacts/deploy/work.karmada.io_resourcebindings.yaml @@ -0,0 +1,228 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.4.1 + creationTimestamp: null + name: resourcebindings.work.karmada.io +spec: + group: work.karmada.io + names: + kind: ResourceBinding + listKind: ResourceBindingList + plural: resourcebindings + singular: resourcebinding + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ResourceBinding represents a binding of a kubernetes resource + with a propagation policy. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec represents the desired behavior. + properties: + clusters: + description: Clusters represents target member clusters where the + resource to be deployed. + items: + description: TargetCluster represents the identifier of a member + cluster. + properties: + name: + description: Name of target cluster. + type: string + required: + - name + type: object + type: array + resource: + description: Resource represents the Kubernetes resource to be propagated. + properties: + apiVersion: + description: APIVersion represents the API version of the referent. + type: string + kind: + description: Kind represents the Kind of the referent. + type: string + name: + description: Name represents the name of the referent. + type: string + namespace: + description: Namespace represents the namespace for the referent. + For non-namespace scoped resources(e.g. 'ClusterRole'),do not + need specify Namespace, and for namespace scoped resources, + Namespace is required. If Namespace is not specified, means + the resource is non-namespace scoped. + type: string + resourceVersion: + description: ResourceVersion represents the internal version of + the referenced object, that can be used by clients to determine + when object has changed. + type: string + required: + - apiVersion + - kind + - name + type: object + required: + - resource + type: object + status: + description: Status represents the most recently observed status of the + ResourceBinding. + properties: + aggregatedStatus: + description: AggregatedStatus represents status list of the resource + running in each member cluster. + items: + description: AggregatedStatusItem represents status of the resource + running in a member cluster. + properties: + clusterName: + description: ClusterName represents the member cluster name + which the resource deployed on. + type: string + resourceStatus: + description: ResourceStatus represents the status of the resource. + properties: + deploymentStatus: + description: Deployment represents the deployment status + in the member cluster, only available when the resource + kind is Deployment. + properties: + availableReplicas: + description: Total number of available pods (ready for + at least minReadySeconds) targeted by this deployment. + format: int32 + type: integer + readyReplicas: + description: Total number of ready pods targeted by + this deployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated pods targeted + by this deployment (their labels match the selector). + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable pods targeted + by this deployment. This is the total number of pods + that are still required for the deployment to have + 100% available capacity. They may either be pods that + are running but not yet available or pods that still + have not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated pods targeted + by this deployment that have the desired template + spec. + format: int32 + type: integer + type: object + type: object + required: + - clusterName + type: object + type: array + conditions: + description: Conditions contain the different condition statuses. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: + \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type + \ // +patchStrategy=merge // +listType=map // +listMapKey=type + \ Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` + \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go index 4643b377d..998594ca5 100644 --- a/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go @@ -10,23 +10,6 @@ import ( 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 *ClusterAffinity) DeepCopyInto(out *ClusterAffinity) { *out = *in @@ -183,22 +166,6 @@ func (in *ClusterPropagationPolicyList) DeepCopyObject() runtime.Object { return nil } -// 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 *FieldSelector) DeepCopyInto(out *FieldSelector) { *out = *in @@ -222,22 +189,6 @@ func (in *FieldSelector) DeepCopy() *FieldSelector { 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 *OverridePolicy) DeepCopyInto(out *OverridePolicy) { *out = *in @@ -485,119 +436,6 @@ func (in *PropagationSpec) DeepCopy() *PropagationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceBinding) DeepCopyInto(out *ResourceBinding) { - *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 ResourceBinding. -func (in *ResourceBinding) DeepCopy() *ResourceBinding { - if in == nil { - return nil - } - out := new(ResourceBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceBinding) 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 *ResourceBindingList) DeepCopyInto(out *ResourceBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBindingList. -func (in *ResourceBindingList) DeepCopy() *ResourceBindingList { - if in == nil { - return nil - } - out := new(ResourceBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceBindingList) 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 *ResourceBindingSpec) DeepCopyInto(out *ResourceBindingSpec) { - *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 ResourceBindingSpec. -func (in *ResourceBindingSpec) DeepCopy() *ResourceBindingSpec { - if in == nil { - return nil - } - out := new(ResourceBindingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceBindingStatus) DeepCopyInto(out *ResourceBindingStatus) { - *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 ResourceBindingStatus. -func (in *ResourceBindingStatus) DeepCopy() *ResourceBindingStatus { - if in == nil { - return nil - } - out := new(ResourceBindingStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceSelector) DeepCopyInto(out *ResourceSelector) { *out = *in @@ -619,27 +457,6 @@ func (in *ResourceSelector) DeepCopy() *ResourceSelector { 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 *SpreadConstraint) DeepCopyInto(out *SpreadConstraint) { *out = *in @@ -655,19 +472,3 @@ func (in *SpreadConstraint) DeepCopy() *SpreadConstraint { 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 -} diff --git a/pkg/apis/policy/v1alpha1/zz_generated.register.go b/pkg/apis/policy/v1alpha1/zz_generated.register.go index 313479b87..d836e24cf 100644 --- a/pkg/apis/policy/v1alpha1/zz_generated.register.go +++ b/pkg/apis/policy/v1alpha1/zz_generated.register.go @@ -50,8 +50,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &OverridePolicyList{}, &PropagationPolicy{}, &PropagationPolicyList{}, - &ResourceBinding{}, - &ResourceBindingList{}, ) // AddToGroupVersion allows the serialization of client types like ListOptions. v1.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/pkg/apis/work/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/work/v1alpha1/zz_generated.deepcopy.go index dbf63c58c..e1dee1dcf 100644 --- a/pkg/apis/work/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/work/v1alpha1/zz_generated.deepcopy.go @@ -9,6 +9,39 @@ import ( 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 @@ -44,6 +77,135 @@ func (in *ManifestStatus) DeepCopy() *ManifestStatus { 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 *ResourceBinding) DeepCopyInto(out *ResourceBinding) { + *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 ResourceBinding. +func (in *ResourceBinding) DeepCopy() *ResourceBinding { + if in == nil { + return nil + } + out := new(ResourceBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResourceBinding) 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 *ResourceBindingList) DeepCopyInto(out *ResourceBindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ResourceBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBindingList. +func (in *ResourceBindingList) DeepCopy() *ResourceBindingList { + if in == nil { + return nil + } + out := new(ResourceBindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResourceBindingList) 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 *ResourceBindingSpec) DeepCopyInto(out *ResourceBindingSpec) { + *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 ResourceBindingSpec. +func (in *ResourceBindingSpec) DeepCopy() *ResourceBindingSpec { + if in == nil { + return nil + } + out := new(ResourceBindingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceBindingStatus) DeepCopyInto(out *ResourceBindingStatus) { + *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 ResourceBindingStatus. +func (in *ResourceBindingStatus) DeepCopy() *ResourceBindingStatus { + if in == nil { + return nil + } + out := new(ResourceBindingStatus) + 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 @@ -60,6 +222,43 @@ func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier { 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 *Work) DeepCopyInto(out *Work) { *out = *in diff --git a/pkg/apis/work/v1alpha1/zz_generated.register.go b/pkg/apis/work/v1alpha1/zz_generated.register.go index 50cdfa937..b373cdc0e 100644 --- a/pkg/apis/work/v1alpha1/zz_generated.register.go +++ b/pkg/apis/work/v1alpha1/zz_generated.register.go @@ -42,6 +42,8 @@ func init() { // Adds the list of known types to Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, + &ResourceBinding{}, + &ResourceBindingList{}, &Work{}, &WorkList{}, ) diff --git a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go b/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go index 168ad081e..df0b85620 100644 --- a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go +++ b/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go @@ -28,10 +28,6 @@ func (c *FakePolicyV1alpha1) PropagationPolicies(namespace string) v1alpha1.Prop return &FakePropagationPolicies{c, namespace} } -func (c *FakePolicyV1alpha1) ResourceBindings(namespace string) v1alpha1.ResourceBindingInterface { - return &FakeResourceBindings{c, namespace} -} - // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakePolicyV1alpha1) RESTClient() rest.Interface { diff --git a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go index bf6757512..77cc117a1 100644 --- a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go @@ -9,5 +9,3 @@ type ClusterPropagationPolicyExpansion interface{} type OverridePolicyExpansion interface{} type PropagationPolicyExpansion interface{} - -type ResourceBindingExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/policy_client.go b/pkg/generated/clientset/versioned/typed/policy/v1alpha1/policy_client.go index e8360e843..486c8b4c9 100644 --- a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/policy_client.go +++ b/pkg/generated/clientset/versioned/typed/policy/v1alpha1/policy_client.go @@ -14,7 +14,6 @@ type PolicyV1alpha1Interface interface { ClusterPropagationPoliciesGetter OverridePoliciesGetter PropagationPoliciesGetter - ResourceBindingsGetter } // PolicyV1alpha1Client is used to interact with features provided by the policy.karmada.io group. @@ -38,10 +37,6 @@ func (c *PolicyV1alpha1Client) PropagationPolicies(namespace string) Propagation return newPropagationPolicies(c, namespace) } -func (c *PolicyV1alpha1Client) ResourceBindings(namespace string) ResourceBindingInterface { - return newResourceBindings(c, namespace) -} - // NewForConfig creates a new PolicyV1alpha1Client for the given config. func NewForConfig(c *rest.Config) (*PolicyV1alpha1Client, error) { config := *c diff --git a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_resourcebinding.go b/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_resourcebinding.go similarity index 94% rename from pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_resourcebinding.go rename to pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_resourcebinding.go index 8129d0caa..9a75ec4a1 100644 --- a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake/fake_resourcebinding.go +++ b/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_resourcebinding.go @@ -5,7 +5,7 @@ package fake import ( "context" - v1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1" + v1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -16,13 +16,13 @@ import ( // FakeResourceBindings implements ResourceBindingInterface type FakeResourceBindings struct { - Fake *FakePolicyV1alpha1 + Fake *FakeWorkV1alpha1 ns string } -var resourcebindingsResource = schema.GroupVersionResource{Group: "policy.karmada.io", Version: "v1alpha1", Resource: "resourcebindings"} +var resourcebindingsResource = schema.GroupVersionResource{Group: "work.karmada.io", Version: "v1alpha1", Resource: "resourcebindings"} -var resourcebindingsKind = schema.GroupVersionKind{Group: "policy.karmada.io", Version: "v1alpha1", Kind: "ResourceBinding"} +var resourcebindingsKind = schema.GroupVersionKind{Group: "work.karmada.io", Version: "v1alpha1", Kind: "ResourceBinding"} // Get takes name of the resourceBinding, and returns the corresponding resourceBinding object, and an error if there is any. func (c *FakeResourceBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceBinding, err error) { diff --git a/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_work_client.go b/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_work_client.go index ec60dd10c..985428541 100644 --- a/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_work_client.go +++ b/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake/fake_work_client.go @@ -12,6 +12,10 @@ type FakeWorkV1alpha1 struct { *testing.Fake } +func (c *FakeWorkV1alpha1) ResourceBindings(namespace string) v1alpha1.ResourceBindingInterface { + return &FakeResourceBindings{c, namespace} +} + func (c *FakeWorkV1alpha1) Works(namespace string) v1alpha1.WorkInterface { return &FakeWorks{c, namespace} } diff --git a/pkg/generated/clientset/versioned/typed/work/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/work/v1alpha1/generated_expansion.go index eb98b8b65..fb511c923 100644 --- a/pkg/generated/clientset/versioned/typed/work/v1alpha1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/work/v1alpha1/generated_expansion.go @@ -2,4 +2,6 @@ package v1alpha1 +type ResourceBindingExpansion interface{} + type WorkExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/resourcebinding.go b/pkg/generated/clientset/versioned/typed/work/v1alpha1/resourcebinding.go similarity index 97% rename from pkg/generated/clientset/versioned/typed/policy/v1alpha1/resourcebinding.go rename to pkg/generated/clientset/versioned/typed/work/v1alpha1/resourcebinding.go index 254f20381..5a0d7f6bd 100644 --- a/pkg/generated/clientset/versioned/typed/policy/v1alpha1/resourcebinding.go +++ b/pkg/generated/clientset/versioned/typed/work/v1alpha1/resourcebinding.go @@ -6,7 +6,7 @@ import ( "context" "time" - v1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1" + v1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1" scheme "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -41,7 +41,7 @@ type resourceBindings struct { } // newResourceBindings returns a ResourceBindings -func newResourceBindings(c *PolicyV1alpha1Client, namespace string) *resourceBindings { +func newResourceBindings(c *WorkV1alpha1Client, namespace string) *resourceBindings { return &resourceBindings{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/generated/clientset/versioned/typed/work/v1alpha1/work_client.go b/pkg/generated/clientset/versioned/typed/work/v1alpha1/work_client.go index 917abb561..c22b46301 100644 --- a/pkg/generated/clientset/versioned/typed/work/v1alpha1/work_client.go +++ b/pkg/generated/clientset/versioned/typed/work/v1alpha1/work_client.go @@ -10,6 +10,7 @@ import ( type WorkV1alpha1Interface interface { RESTClient() rest.Interface + ResourceBindingsGetter WorksGetter } @@ -18,6 +19,10 @@ type WorkV1alpha1Client struct { restClient rest.Interface } +func (c *WorkV1alpha1Client) ResourceBindings(namespace string) ResourceBindingInterface { + return newResourceBindings(c, namespace) +} + func (c *WorkV1alpha1Client) Works(namespace string) WorkInterface { return newWorks(c, namespace) } diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index bbf9daed8..72bf870fd 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -51,10 +51,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1alpha1().OverridePolicies().Informer()}, nil case policyv1alpha1.SchemeGroupVersion.WithResource("propagationpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1alpha1().PropagationPolicies().Informer()}, nil - case policyv1alpha1.SchemeGroupVersion.WithResource("resourcebindings"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1alpha1().ResourceBindings().Informer()}, nil // Group=work.karmada.io, Version=v1alpha1 + case workv1alpha1.SchemeGroupVersion.WithResource("resourcebindings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Work().V1alpha1().ResourceBindings().Informer()}, nil case workv1alpha1.SchemeGroupVersion.WithResource("works"): return &genericInformer{resource: resource.GroupResource(), informer: f.Work().V1alpha1().Works().Informer()}, nil diff --git a/pkg/generated/informers/externalversions/policy/v1alpha1/interface.go b/pkg/generated/informers/externalversions/policy/v1alpha1/interface.go index fb8b8279e..74e472f9d 100644 --- a/pkg/generated/informers/externalversions/policy/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/policy/v1alpha1/interface.go @@ -16,8 +16,6 @@ type Interface interface { OverridePolicies() OverridePolicyInformer // PropagationPolicies returns a PropagationPolicyInformer. PropagationPolicies() PropagationPolicyInformer - // ResourceBindings returns a ResourceBindingInformer. - ResourceBindings() ResourceBindingInformer } type version struct { @@ -50,8 +48,3 @@ func (v *version) OverridePolicies() OverridePolicyInformer { func (v *version) PropagationPolicies() PropagationPolicyInformer { return &propagationPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } - -// ResourceBindings returns a ResourceBindingInformer. -func (v *version) ResourceBindings() ResourceBindingInformer { - return &resourceBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/generated/informers/externalversions/work/v1alpha1/interface.go b/pkg/generated/informers/externalversions/work/v1alpha1/interface.go index f8924eebe..72291634e 100644 --- a/pkg/generated/informers/externalversions/work/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/work/v1alpha1/interface.go @@ -8,6 +8,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // ResourceBindings returns a ResourceBindingInformer. + ResourceBindings() ResourceBindingInformer // Works returns a WorkInformer. Works() WorkInformer } @@ -23,6 +25,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// ResourceBindings returns a ResourceBindingInformer. +func (v *version) ResourceBindings() ResourceBindingInformer { + return &resourceBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // Works returns a WorkInformer. func (v *version) Works() WorkInformer { return &workInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/generated/informers/externalversions/policy/v1alpha1/resourcebinding.go b/pkg/generated/informers/externalversions/work/v1alpha1/resourcebinding.go similarity index 85% rename from pkg/generated/informers/externalversions/policy/v1alpha1/resourcebinding.go rename to pkg/generated/informers/externalversions/work/v1alpha1/resourcebinding.go index 38a335dbe..1c6efee7d 100644 --- a/pkg/generated/informers/externalversions/policy/v1alpha1/resourcebinding.go +++ b/pkg/generated/informers/externalversions/work/v1alpha1/resourcebinding.go @@ -6,10 +6,10 @@ import ( "context" time "time" - policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1" + workv1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1" versioned "github.com/karmada-io/karmada/pkg/generated/clientset/versioned" internalinterfaces "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/karmada-io/karmada/pkg/generated/listers/policy/v1alpha1" + v1alpha1 "github.com/karmada-io/karmada/pkg/generated/listers/work/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -46,16 +46,16 @@ func NewFilteredResourceBindingInformer(client versioned.Interface, namespace st if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1alpha1().ResourceBindings(namespace).List(context.TODO(), options) + return client.WorkV1alpha1().ResourceBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1alpha1().ResourceBindings(namespace).Watch(context.TODO(), options) + return client.WorkV1alpha1().ResourceBindings(namespace).Watch(context.TODO(), options) }, }, - &policyv1alpha1.ResourceBinding{}, + &workv1alpha1.ResourceBinding{}, resyncPeriod, indexers, ) @@ -66,7 +66,7 @@ func (f *resourceBindingInformer) defaultInformer(client versioned.Interface, re } func (f *resourceBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policyv1alpha1.ResourceBinding{}, f.defaultInformer) + return f.factory.InformerFor(&workv1alpha1.ResourceBinding{}, f.defaultInformer) } func (f *resourceBindingInformer) Lister() v1alpha1.ResourceBindingLister { diff --git a/pkg/generated/listers/policy/v1alpha1/expansion_generated.go b/pkg/generated/listers/policy/v1alpha1/expansion_generated.go index 0eeca16d9..cc58c27c6 100644 --- a/pkg/generated/listers/policy/v1alpha1/expansion_generated.go +++ b/pkg/generated/listers/policy/v1alpha1/expansion_generated.go @@ -25,11 +25,3 @@ type PropagationPolicyListerExpansion interface{} // PropagationPolicyNamespaceListerExpansion allows custom methods to be added to // PropagationPolicyNamespaceLister. type PropagationPolicyNamespaceListerExpansion interface{} - -// ResourceBindingListerExpansion allows custom methods to be added to -// ResourceBindingLister. -type ResourceBindingListerExpansion interface{} - -// ResourceBindingNamespaceListerExpansion allows custom methods to be added to -// ResourceBindingNamespaceLister. -type ResourceBindingNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/work/v1alpha1/expansion_generated.go b/pkg/generated/listers/work/v1alpha1/expansion_generated.go index c24f5ed22..a46c4c7e5 100644 --- a/pkg/generated/listers/work/v1alpha1/expansion_generated.go +++ b/pkg/generated/listers/work/v1alpha1/expansion_generated.go @@ -2,6 +2,14 @@ package v1alpha1 +// ResourceBindingListerExpansion allows custom methods to be added to +// ResourceBindingLister. +type ResourceBindingListerExpansion interface{} + +// ResourceBindingNamespaceListerExpansion allows custom methods to be added to +// ResourceBindingNamespaceLister. +type ResourceBindingNamespaceListerExpansion interface{} + // WorkListerExpansion allows custom methods to be added to // WorkLister. type WorkListerExpansion interface{} diff --git a/pkg/generated/listers/policy/v1alpha1/resourcebinding.go b/pkg/generated/listers/work/v1alpha1/resourcebinding.go similarity index 97% rename from pkg/generated/listers/policy/v1alpha1/resourcebinding.go rename to pkg/generated/listers/work/v1alpha1/resourcebinding.go index 66b5a15ba..c8f4f1474 100644 --- a/pkg/generated/listers/policy/v1alpha1/resourcebinding.go +++ b/pkg/generated/listers/work/v1alpha1/resourcebinding.go @@ -3,7 +3,7 @@ package v1alpha1 import ( - v1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1" + v1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache"