Add a CRD for the cached member cluster and resource scope. (#1674)

* Add a CRD named ClusterCache for the cached member cluster and resource scope

Co-authored-by: liys87x <liyasong1987x@gmail.com>
Signed-off-by: huntsman_ly <huntsman_ly@sina.com>

* set resource scoped to cluster-scoped

Co-authored-by: liys87x <liyasong1987x@gmail.com>
Signed-off-by: huntsman_ly <huntsman_ly@sina.com>

* Change the group name to search.karmada.io
Change the kind name to ResourceRegistry
Remove the CachePhase filed; add Conditions

Co-authored-by: liys87x <liyasong1987x@gmail.com>
Signed-off-by: huntsman_ly <huntsman_ly@sina.com>

Co-authored-by: huntsman_ly <huntsman_ly@sina.com>
This commit is contained in:
YasongLi 2022-05-07 12:28:27 +08:00 committed by GitHub
parent 810048fe89
commit da68d952e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 1642 additions and 3 deletions

View File

@ -0,0 +1,255 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: resourceregistries.search.karmada.io
spec:
group: search.karmada.io
names:
kind: ResourceRegistry
listKind: ResourceRegistryList
plural: resourceregistries
singular: resourceregistry
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ResourceRegistry defines a list of member cluster to be cached.
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 of ResourceRegistry.
properties:
clusterSelectors:
description: ClusterSelectors represents the filter to select clusters.
items:
description: ClusterSelector represents the filter to select clusters.
properties:
clusterNames:
description: ClusterNames is the list of clusters to be selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to be
ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match
this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists,
DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the operator
is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. If the operator is Gt or Lt,
the values array must have a single element, which
will be interpreted as an integer. This array is
replaced during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member clusters
by labels. If non-nil and non-empty, only the clusters match
this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty. This
array is replaced during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
type: object
type: array
resourceSelectors:
description: ResourceSelectors used to select resources.
items:
description: ResourceSelector the resources will be selected.
properties:
apiVersion:
description: APIVersion represents the API version of the target
resources.
type: string
kind:
description: Kind represents the Kind of the target resources.
type: string
namespace:
description: Namespace of the target resource. Default is empty,
which means all namespaces.
type: string
required:
- apiVersion
- kind
type: object
type: array
statusUpdatePeriodSeconds:
description: StatusUpdatePeriodSeconds is the period to update the
status of the resource. default is 10s.
format: int32
type: integer
required:
- clusterSelectors
- resourceSelectors
type: object
status:
description: Status represents the status of ResoruceRegistry.
properties:
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
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -53,6 +53,11 @@ deepcopy-gen \
--input-dirs=github.com/karmada-io/karmada/examples/customresourceinterpreter/apis/workload/v1alpha1 \
--output-package=github.com/karmada-io/karmada/examples/customresourceinterpreter/apis/workload/v1alpha1 \
--output-file-base=zz_generated.deepcopy
deepcopy-gen \
--go-header-file hack/boilerplate/boilerplate.go.txt \
--input-dirs=github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--output-package=github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--output-file-base=zz_generated.deepcopy
echo "Generating with register-gen"
GO111MODULE=on go install k8s.io/code-generator/cmd/register-gen
@ -91,6 +96,11 @@ register-gen \
--input-dirs=github.com/karmada-io/karmada/examples/customresourceinterpreter/apis/workload/v1alpha1 \
--output-package=github.com/karmada-io/karmada/examples/customresourceinterpreter/apis/workload/v1alpha1 \
--output-file-base=zz_generated.register
register-gen \
--go-header-file hack/boilerplate/boilerplate.go.txt \
--input-dirs=github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--output-package=github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--output-file-base=zz_generated.register
echo "Generating with conversion-gen"
GO111MODULE=on go install k8s.io/code-generator/cmd/conversion-gen
@ -105,7 +115,7 @@ GO111MODULE=on go install k8s.io/code-generator/cmd/client-gen
client-gen \
--go-header-file hack/boilerplate/boilerplate.go.txt \
--input-base="" \
--input=github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1,github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha2,github.com/karmada-io/karmada/pkg/apis/config/v1alpha1,github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1 \
--input=github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1,github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha2,github.com/karmada-io/karmada/pkg/apis/config/v1alpha1,github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1,github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--output-package=github.com/karmada-io/karmada/pkg/generated/clientset \
--clientset-name=versioned
@ -113,14 +123,14 @@ echo "Generating with lister-gen"
GO111MODULE=on go install k8s.io/code-generator/cmd/lister-gen
lister-gen \
--go-header-file hack/boilerplate/boilerplate.go.txt \
--input-dirs=github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1,github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha2,github.com/karmada-io/karmada/pkg/apis/config/v1alpha1,github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1 \
--input-dirs=github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1,github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha2,github.com/karmada-io/karmada/pkg/apis/config/v1alpha1,github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1,github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--output-package=github.com/karmada-io/karmada/pkg/generated/listers
echo "Generating with informer-gen"
GO111MODULE=on go install k8s.io/code-generator/cmd/informer-gen
informer-gen \
--go-header-file hack/boilerplate/boilerplate.go.txt \
--input-dirs=github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1,github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha2,github.com/karmada-io/karmada/pkg/apis/config/v1alpha1,github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1 \
--input-dirs=github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1,github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha1,github.com/karmada-io/karmada/pkg/apis/work/v1alpha2,github.com/karmada-io/karmada/pkg/apis/config/v1alpha1,github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1,github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
--versioned-clientset-package=github.com/karmada-io/karmada/pkg/generated/clientset/versioned \
--listers-package=github.com/karmada-io/karmada/pkg/generated/listers \
--output-package=github.com/karmada-io/karmada/pkg/generated/informers
@ -138,6 +148,7 @@ openapi-gen \
--input-dirs "k8s.io/api/core/v1,k8s.io/apimachinery/pkg/api/resource" \
--input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \
--input-dirs "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,k8s.io/api/admissionregistration/v1,k8s.io/api/networking/v1" \
--input-dirs "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1" \
--output-package "github.com/karmada-io/karmada/pkg/generated/openapi" \
-O zz_generated.openapi

View File

@ -18,3 +18,4 @@ controller-gen crd paths=./pkg/apis/policy/... output:crd:dir=./charts/_crds/bas
controller-gen crd paths=./pkg/apis/work/... output:crd:dir=./charts/_crds/bases
controller-gen crd paths=./pkg/apis/networking/... output:crd:dir=./charts/_crds/bases
controller-gen crd paths=./examples/customresourceinterpreter/apis/... output:crd:dir=./examples/customresourceinterpreter/apis/
controller-gen crd paths=./pkg/apis/search/... output:crd:dir=./charts/_crds/bases

View File

@ -0,0 +1,113 @@
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
// ResourceKindResourceRegistry is the name of the resource registry
ResourceKindResourceRegistry = "ResourceRegistry"
// ResourceSingularResourceRegistry is singular name of ResourceRegistry.
ResourceSingularResourceRegistry = "resourceRegistry"
// ResourcePluralResourceRegistry is plural name of ResourceRegistry.
ResourcePluralResourceRegistry = "resourceRegistries"
// ResourceNamespaceScopedResourceRegistry is the scope of the ResourceRegistry
ResourceNamespaceScopedResourceRegistry = false
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope="Cluster"
// ResourceRegistry defines a list of member cluster to be cached.
type ResourceRegistry struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec represents the desired behavior of ResourceRegistry.
Spec ResourceRegistrySpec `json:"spec,omitempty"`
// Status represents the status of ResoruceRegistry.
// +optional
Status ResourceRegistryStatus `json:"status,omitempty"`
}
// ResourceRegistrySpec defines the desired state of ResourceRegistry.
type ResourceRegistrySpec struct {
// ClusterSelectors represents the filter to select clusters.
// +required
ClusterSelectors []ClusterSelector `json:"clusterSelectors"`
// ResourceSelectors used to select resources.
// +required
ResourceSelectors []ResourceSelector `json:"resourceSelectors"`
// StatusUpdatePeriodSeconds is the period to update the status of the resource.
// default is 10s.
// +optional
StatusUpdatePeriodSeconds uint32 `json:"statusUpdatePeriodSeconds,omitempty"`
}
// ClusterSelector represents the filter to select clusters.
type ClusterSelector struct {
// LabelSelector is a filter to select member clusters by labels.
// If non-nil and non-empty, only the clusters match this filter will be selected.
// +optional
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
// FieldSelector is a filter to select member clusters by fields.
// If non-nil and non-empty, only the clusters match this filter will be selected.
// +optional
FieldSelector *FieldSelector `json:"fieldSelector,omitempty"`
// ClusterNames is the list of clusters to be selected.
// +optional
ClusterNames []string `json:"clusterNames,omitempty"`
// ExcludedClusters is the list of clusters to be ignored.
// +optional
ExcludeClusters []string `json:"exclude,omitempty"`
}
// FieldSelector is a field filter.
type FieldSelector struct {
// A list of field selector requirements.
MatchExpressions []corev1.NodeSelectorRequirement `json:"matchExpressions,omitempty"`
}
// ResourceSelector the resources will be selected.
type ResourceSelector struct {
// APIVersion represents the API version of the target resources.
// +required
APIVersion string `json:"apiVersion"`
// Kind represents the Kind of the target resources.
// +required
Kind string `json:"kind"`
// Namespace of the target resource.
// Default is empty, which means all namespaces.
// +optional
Namespace string `json:"namespace,omitempty"`
}
// ResourceRegistryStatus defines the observed state of ResourceRegistry
type ResourceRegistryStatus struct {
// Conditions contain the different condition statuses.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
// +kubebuilder:resource:scope="Cluster"
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ResourceRegistryList if a collection of ResourceRegistry.
type ResourceRegistryList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items holds a list of ResourceRegistry.
Items []ResourceRegistry `json:"items"`
}

View File

@ -0,0 +1,5 @@
// Package v1alpha1 is the v1alpha1 version of the API.
// +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +groupName=search.karmada.io
package v1alpha1

View File

@ -0,0 +1,199 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
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 *ClusterSelector) DeepCopyInto(out *ClusterSelector) {
*out = *in
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
*out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.FieldSelector != nil {
in, out := &in.FieldSelector, &out.FieldSelector
*out = new(FieldSelector)
(*in).DeepCopyInto(*out)
}
if in.ClusterNames != nil {
in, out := &in.ClusterNames, &out.ClusterNames
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ExcludeClusters != nil {
in, out := &in.ExcludeClusters, &out.ExcludeClusters
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelector.
func (in *ClusterSelector) DeepCopy() *ClusterSelector {
if in == nil {
return nil
}
out := new(ClusterSelector)
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
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]corev1.NodeSelectorRequirement, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldSelector.
func (in *FieldSelector) DeepCopy() *FieldSelector {
if in == nil {
return nil
}
out := new(FieldSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceRegistry) DeepCopyInto(out *ResourceRegistry) {
*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 ResourceRegistry.
func (in *ResourceRegistry) DeepCopy() *ResourceRegistry {
if in == nil {
return nil
}
out := new(ResourceRegistry)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ResourceRegistry) 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 *ResourceRegistryList) DeepCopyInto(out *ResourceRegistryList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ResourceRegistry, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRegistryList.
func (in *ResourceRegistryList) DeepCopy() *ResourceRegistryList {
if in == nil {
return nil
}
out := new(ResourceRegistryList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ResourceRegistryList) 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 *ResourceRegistrySpec) DeepCopyInto(out *ResourceRegistrySpec) {
*out = *in
if in.ClusterSelectors != nil {
in, out := &in.ClusterSelectors, &out.ClusterSelectors
*out = make([]ClusterSelector, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceSelectors != nil {
in, out := &in.ResourceSelectors, &out.ResourceSelectors
*out = make([]ResourceSelector, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRegistrySpec.
func (in *ResourceRegistrySpec) DeepCopy() *ResourceRegistrySpec {
if in == nil {
return nil
}
out := new(ResourceRegistrySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceRegistryStatus) DeepCopyInto(out *ResourceRegistryStatus) {
*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])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRegistryStatus.
func (in *ResourceRegistryStatus) DeepCopy() *ResourceRegistryStatus {
if in == nil {
return nil
}
out := new(ResourceRegistryStatus)
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
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSelector.
func (in *ResourceSelector) DeepCopy() *ResourceSelector {
if in == nil {
return nil
}
out := new(ResourceSelector)
in.DeepCopyInto(out)
return out
}

View File

@ -0,0 +1,51 @@
// Code generated by register-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName specifies the group name used to register the objects.
const GroupName = "search.karmada.io"
// GroupVersion specifies the group and the version used to register the objects.
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}
// SchemeGroupVersion is group version used to register these objects
// Deprecated: use GroupVersion instead.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder
// Depreciated: use Install instead
AddToScheme = localSchemeBuilder.AddToScheme
Install = localSchemeBuilder.AddToScheme
)
func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder.Register(addKnownTypes)
}
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&ResourceRegistry{},
&ResourceRegistryList{},
)
// AddToGroupVersion allows the serialization of client types like ListOptions.
v1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@ -10,6 +10,7 @@ import (
configv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/config/v1alpha1"
networkingv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/networking/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/policy/v1alpha1"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/search/v1alpha1"
workv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/work/v1alpha1"
workv1alpha2 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/work/v1alpha2"
discovery "k8s.io/client-go/discovery"
@ -23,6 +24,7 @@ type Interface interface {
ConfigV1alpha1() configv1alpha1.ConfigV1alpha1Interface
NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface
PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface
SearchV1alpha1() searchv1alpha1.SearchV1alpha1Interface
WorkV1alpha1() workv1alpha1.WorkV1alpha1Interface
WorkV1alpha2() workv1alpha2.WorkV1alpha2Interface
}
@ -35,6 +37,7 @@ type Clientset struct {
configV1alpha1 *configv1alpha1.ConfigV1alpha1Client
networkingV1alpha1 *networkingv1alpha1.NetworkingV1alpha1Client
policyV1alpha1 *policyv1alpha1.PolicyV1alpha1Client
searchV1alpha1 *searchv1alpha1.SearchV1alpha1Client
workV1alpha1 *workv1alpha1.WorkV1alpha1Client
workV1alpha2 *workv1alpha2.WorkV1alpha2Client
}
@ -59,6 +62,11 @@ func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface {
return c.policyV1alpha1
}
// SearchV1alpha1 retrieves the SearchV1alpha1Client
func (c *Clientset) SearchV1alpha1() searchv1alpha1.SearchV1alpha1Interface {
return c.searchV1alpha1
}
// WorkV1alpha1 retrieves the WorkV1alpha1Client
func (c *Clientset) WorkV1alpha1() workv1alpha1.WorkV1alpha1Interface {
return c.workV1alpha1
@ -125,6 +133,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
if err != nil {
return nil, err
}
cs.searchV1alpha1, err = searchv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.workV1alpha1, err = workv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
@ -158,6 +170,7 @@ func New(c rest.Interface) *Clientset {
cs.configV1alpha1 = configv1alpha1.New(c)
cs.networkingV1alpha1 = networkingv1alpha1.New(c)
cs.policyV1alpha1 = policyv1alpha1.New(c)
cs.searchV1alpha1 = searchv1alpha1.New(c)
cs.workV1alpha1 = workv1alpha1.New(c)
cs.workV1alpha2 = workv1alpha2.New(c)

View File

@ -12,6 +12,8 @@ import (
fakenetworkingv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/policy/v1alpha1"
fakepolicyv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/policy/v1alpha1/fake"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/search/v1alpha1"
fakesearchv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/search/v1alpha1/fake"
workv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/work/v1alpha1"
fakeworkv1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/work/v1alpha1/fake"
workv1alpha2 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/work/v1alpha2"
@ -93,6 +95,11 @@ func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface {
return &fakepolicyv1alpha1.FakePolicyV1alpha1{Fake: &c.Fake}
}
// SearchV1alpha1 retrieves the SearchV1alpha1Client
func (c *Clientset) SearchV1alpha1() searchv1alpha1.SearchV1alpha1Interface {
return &fakesearchv1alpha1.FakeSearchV1alpha1{Fake: &c.Fake}
}
// WorkV1alpha1 retrieves the WorkV1alpha1Client
func (c *Clientset) WorkV1alpha1() workv1alpha1.WorkV1alpha1Interface {
return &fakeworkv1alpha1.FakeWorkV1alpha1{Fake: &c.Fake}

View File

@ -7,6 +7,7 @@ import (
configv1alpha1 "github.com/karmada-io/karmada/pkg/apis/config/v1alpha1"
networkingv1alpha1 "github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
workv1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1"
workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -24,6 +25,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
configv1alpha1.AddToScheme,
networkingv1alpha1.AddToScheme,
policyv1alpha1.AddToScheme,
searchv1alpha1.AddToScheme,
workv1alpha1.AddToScheme,
workv1alpha2.AddToScheme,
}

View File

@ -7,6 +7,7 @@ import (
configv1alpha1 "github.com/karmada-io/karmada/pkg/apis/config/v1alpha1"
networkingv1alpha1 "github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
workv1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1"
workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -24,6 +25,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
configv1alpha1.AddToScheme,
networkingv1alpha1.AddToScheme,
policyv1alpha1.AddToScheme,
searchv1alpha1.AddToScheme,
workv1alpha1.AddToScheme,
workv1alpha2.AddToScheme,
}

View File

@ -0,0 +1,4 @@
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View File

@ -0,0 +1,4 @@
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@ -0,0 +1,126 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/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"
)
// FakeResourceRegistries implements ResourceRegistryInterface
type FakeResourceRegistries struct {
Fake *FakeSearchV1alpha1
ns string
}
var resourceregistriesResource = schema.GroupVersionResource{Group: "search.karmada.io", Version: "v1alpha1", Resource: "resourceregistries"}
var resourceregistriesKind = schema.GroupVersionKind{Group: "search.karmada.io", Version: "v1alpha1", Kind: "ResourceRegistry"}
// Get takes name of the resourceRegistry, and returns the corresponding resourceRegistry object, and an error if there is any.
func (c *FakeResourceRegistries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceRegistry, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(resourceregistriesResource, c.ns, name), &v1alpha1.ResourceRegistry{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ResourceRegistry), err
}
// List takes label and field selectors, and returns the list of ResourceRegistries that match those selectors.
func (c *FakeResourceRegistries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceRegistryList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(resourceregistriesResource, resourceregistriesKind, c.ns, opts), &v1alpha1.ResourceRegistryList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ResourceRegistryList{ListMeta: obj.(*v1alpha1.ResourceRegistryList).ListMeta}
for _, item := range obj.(*v1alpha1.ResourceRegistryList).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 resourceRegistries.
func (c *FakeResourceRegistries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(resourceregistriesResource, c.ns, opts))
}
// Create takes the representation of a resourceRegistry and creates it. Returns the server's representation of the resourceRegistry, and an error, if there is any.
func (c *FakeResourceRegistries) Create(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.CreateOptions) (result *v1alpha1.ResourceRegistry, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(resourceregistriesResource, c.ns, resourceRegistry), &v1alpha1.ResourceRegistry{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ResourceRegistry), err
}
// Update takes the representation of a resourceRegistry and updates it. Returns the server's representation of the resourceRegistry, and an error, if there is any.
func (c *FakeResourceRegistries) Update(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.UpdateOptions) (result *v1alpha1.ResourceRegistry, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(resourceregistriesResource, c.ns, resourceRegistry), &v1alpha1.ResourceRegistry{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ResourceRegistry), 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 *FakeResourceRegistries) UpdateStatus(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.UpdateOptions) (*v1alpha1.ResourceRegistry, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(resourceregistriesResource, "status", c.ns, resourceRegistry), &v1alpha1.ResourceRegistry{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ResourceRegistry), err
}
// Delete takes name of the resourceRegistry and deletes it. Returns an error if one occurs.
func (c *FakeResourceRegistries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(resourceregistriesResource, c.ns, name, opts), &v1alpha1.ResourceRegistry{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeResourceRegistries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(resourceregistriesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ResourceRegistryList{})
return err
}
// Patch applies the patch and returns the patched resourceRegistry.
func (c *FakeResourceRegistries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceRegistry, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resourceregistriesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ResourceRegistry{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ResourceRegistry), err
}

View File

@ -0,0 +1,24 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "github.com/karmada-io/karmada/pkg/generated/clientset/versioned/typed/search/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeSearchV1alpha1 struct {
*testing.Fake
}
func (c *FakeSearchV1alpha1) ResourceRegistries(namespace string) v1alpha1.ResourceRegistryInterface {
return &FakeResourceRegistries{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeSearchV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -0,0 +1,5 @@
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type ResourceRegistryExpansion interface{}

View File

@ -0,0 +1,179 @@
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/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"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ResourceRegistriesGetter has a method to return a ResourceRegistryInterface.
// A group's client should implement this interface.
type ResourceRegistriesGetter interface {
ResourceRegistries(namespace string) ResourceRegistryInterface
}
// ResourceRegistryInterface has methods to work with ResourceRegistry resources.
type ResourceRegistryInterface interface {
Create(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.CreateOptions) (*v1alpha1.ResourceRegistry, error)
Update(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.UpdateOptions) (*v1alpha1.ResourceRegistry, error)
UpdateStatus(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.UpdateOptions) (*v1alpha1.ResourceRegistry, 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.ResourceRegistry, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ResourceRegistryList, 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.ResourceRegistry, err error)
ResourceRegistryExpansion
}
// resourceRegistries implements ResourceRegistryInterface
type resourceRegistries struct {
client rest.Interface
ns string
}
// newResourceRegistries returns a ResourceRegistries
func newResourceRegistries(c *SearchV1alpha1Client, namespace string) *resourceRegistries {
return &resourceRegistries{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the resourceRegistry, and returns the corresponding resourceRegistry object, and an error if there is any.
func (c *resourceRegistries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceRegistry, err error) {
result = &v1alpha1.ResourceRegistry{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourceregistries").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ResourceRegistries that match those selectors.
func (c *resourceRegistries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceRegistryList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ResourceRegistryList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourceregistries").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceRegistries.
func (c *resourceRegistries) 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("resourceregistries").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a resourceRegistry and creates it. Returns the server's representation of the resourceRegistry, and an error, if there is any.
func (c *resourceRegistries) Create(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.CreateOptions) (result *v1alpha1.ResourceRegistry, err error) {
result = &v1alpha1.ResourceRegistry{}
err = c.client.Post().
Namespace(c.ns).
Resource("resourceregistries").
VersionedParams(&opts, scheme.ParameterCodec).
Body(resourceRegistry).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a resourceRegistry and updates it. Returns the server's representation of the resourceRegistry, and an error, if there is any.
func (c *resourceRegistries) Update(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.UpdateOptions) (result *v1alpha1.ResourceRegistry, err error) {
result = &v1alpha1.ResourceRegistry{}
err = c.client.Put().
Namespace(c.ns).
Resource("resourceregistries").
Name(resourceRegistry.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(resourceRegistry).
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 *resourceRegistries) UpdateStatus(ctx context.Context, resourceRegistry *v1alpha1.ResourceRegistry, opts v1.UpdateOptions) (result *v1alpha1.ResourceRegistry, err error) {
result = &v1alpha1.ResourceRegistry{}
err = c.client.Put().
Namespace(c.ns).
Resource("resourceregistries").
Name(resourceRegistry.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(resourceRegistry).
Do(ctx).
Into(result)
return
}
// Delete takes name of the resourceRegistry and deletes it. Returns an error if one occurs.
func (c *resourceRegistries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resourceregistries").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *resourceRegistries) 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("resourceregistries").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched resourceRegistry.
func (c *resourceRegistries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceRegistry, err error) {
result = &v1alpha1.ResourceRegistry{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("resourceregistries").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -0,0 +1,91 @@
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"net/http"
v1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
"github.com/karmada-io/karmada/pkg/generated/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type SearchV1alpha1Interface interface {
RESTClient() rest.Interface
ResourceRegistriesGetter
}
// SearchV1alpha1Client is used to interact with features provided by the search.karmada.io group.
type SearchV1alpha1Client struct {
restClient rest.Interface
}
func (c *SearchV1alpha1Client) ResourceRegistries(namespace string) ResourceRegistryInterface {
return newResourceRegistries(c, namespace)
}
// NewForConfig creates a new SearchV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*SearchV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new SearchV1alpha1Client for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SearchV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
return &SearchV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new SearchV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *SearchV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new SearchV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *SearchV1alpha1Client {
return &SearchV1alpha1Client{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 *SearchV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -13,6 +13,7 @@ import (
internalinterfaces "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/internalinterfaces"
networking "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/networking"
policy "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/policy"
search "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/search"
work "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/work"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
@ -164,6 +165,7 @@ type SharedInformerFactory interface {
Config() config.Interface
Networking() networking.Interface
Policy() policy.Interface
Search() search.Interface
Work() work.Interface
}
@ -183,6 +185,10 @@ func (f *sharedInformerFactory) Policy() policy.Interface {
return policy.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Search() search.Interface {
return search.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Work() work.Interface {
return work.New(f, f.namespace, f.tweakListOptions)
}

View File

@ -9,6 +9,7 @@ import (
configv1alpha1 "github.com/karmada-io/karmada/pkg/apis/config/v1alpha1"
networkingv1alpha1 "github.com/karmada-io/karmada/pkg/apis/networking/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
workv1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1"
v1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -65,6 +66,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case policyv1alpha1.SchemeGroupVersion.WithResource("propagationpolicies"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1alpha1().PropagationPolicies().Informer()}, nil
// Group=search.karmada.io, Version=v1alpha1
case searchv1alpha1.SchemeGroupVersion.WithResource("resourceregistries"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Search().V1alpha1().ResourceRegistries().Informer()}, nil
// Group=work.karmada.io, Version=v1alpha1
case workv1alpha1.SchemeGroupVersion.WithResource("clusterresourcebindings"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Work().V1alpha1().ClusterResourceBindings().Informer()}, nil

View File

@ -0,0 +1,30 @@
// Code generated by informer-gen. DO NOT EDIT.
package search
import (
internalinterfaces "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/search/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)
}

View File

@ -0,0 +1,29 @@
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
internalinterfaces "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// ResourceRegistries returns a ResourceRegistryInformer.
ResourceRegistries() ResourceRegistryInformer
}
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}
}
// ResourceRegistries returns a ResourceRegistryInformer.
func (v *version) ResourceRegistries() ResourceRegistryInformer {
return &resourceRegistryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}

View File

@ -0,0 +1,74 @@
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/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/search/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"
)
// ResourceRegistryInformer provides access to a shared informer and lister for
// ResourceRegistries.
type ResourceRegistryInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ResourceRegistryLister
}
type resourceRegistryInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewResourceRegistryInformer constructs a new informer for ResourceRegistry 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 NewResourceRegistryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredResourceRegistryInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredResourceRegistryInformer constructs a new informer for ResourceRegistry 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 NewFilteredResourceRegistryInformer(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.SearchV1alpha1().ResourceRegistries(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SearchV1alpha1().ResourceRegistries(namespace).Watch(context.TODO(), options)
},
},
&searchv1alpha1.ResourceRegistry{},
resyncPeriod,
indexers,
)
}
func (f *resourceRegistryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredResourceRegistryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *resourceRegistryInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&searchv1alpha1.ResourceRegistry{}, f.defaultInformer)
}
func (f *resourceRegistryInformer) Lister() v1alpha1.ResourceRegistryLister {
return v1alpha1.NewResourceRegistryLister(f.Informer().GetIndexer())
}

View File

@ -0,0 +1,11 @@
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
// ResourceRegistryListerExpansion allows custom methods to be added to
// ResourceRegistryLister.
type ResourceRegistryListerExpansion interface{}
// ResourceRegistryNamespaceListerExpansion allows custom methods to be added to
// ResourceRegistryNamespaceLister.
type ResourceRegistryNamespaceListerExpansion interface{}

View File

@ -0,0 +1,83 @@
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// ResourceRegistryLister helps list ResourceRegistries.
// All objects returned here must be treated as read-only.
type ResourceRegistryLister interface {
// List lists all ResourceRegistries in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ResourceRegistry, err error)
// ResourceRegistries returns an object that can list and get ResourceRegistries.
ResourceRegistries(namespace string) ResourceRegistryNamespaceLister
ResourceRegistryListerExpansion
}
// resourceRegistryLister implements the ResourceRegistryLister interface.
type resourceRegistryLister struct {
indexer cache.Indexer
}
// NewResourceRegistryLister returns a new ResourceRegistryLister.
func NewResourceRegistryLister(indexer cache.Indexer) ResourceRegistryLister {
return &resourceRegistryLister{indexer: indexer}
}
// List lists all ResourceRegistries in the indexer.
func (s *resourceRegistryLister) List(selector labels.Selector) (ret []*v1alpha1.ResourceRegistry, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ResourceRegistry))
})
return ret, err
}
// ResourceRegistries returns an object that can list and get ResourceRegistries.
func (s *resourceRegistryLister) ResourceRegistries(namespace string) ResourceRegistryNamespaceLister {
return resourceRegistryNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// ResourceRegistryNamespaceLister helps list and get ResourceRegistries.
// All objects returned here must be treated as read-only.
type ResourceRegistryNamespaceLister interface {
// List lists all ResourceRegistries in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ResourceRegistry, err error)
// Get retrieves the ResourceRegistry from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ResourceRegistry, error)
ResourceRegistryNamespaceListerExpansion
}
// resourceRegistryNamespaceLister implements the ResourceRegistryNamespaceLister
// interface.
type resourceRegistryNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all ResourceRegistries in the indexer for a given namespace.
func (s resourceRegistryNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ResourceRegistry, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ResourceRegistry))
})
return ret, err
}
// Get retrieves the ResourceRegistry from the indexer for a given namespace and name.
func (s resourceRegistryNamespaceLister) Get(name string) (*v1alpha1.ResourceRegistry, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("resourceregistry"), name)
}
return obj.(*v1alpha1.ResourceRegistry), nil
}

View File

@ -69,6 +69,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.SpreadConstraint": schema_pkg_apis_policy_v1alpha1_SpreadConstraint(ref),
"github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.StaticClusterAssignment": schema_pkg_apis_policy_v1alpha1_StaticClusterAssignment(ref),
"github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.StaticClusterWeight": schema_pkg_apis_policy_v1alpha1_StaticClusterWeight(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ClusterSelector": schema_pkg_apis_search_v1alpha1_ClusterSelector(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.FieldSelector": schema_pkg_apis_search_v1alpha1_FieldSelector(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistry": schema_pkg_apis_search_v1alpha1_ResourceRegistry(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistryList": schema_pkg_apis_search_v1alpha1_ResourceRegistryList(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistrySpec": schema_pkg_apis_search_v1alpha1_ResourceRegistrySpec(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistryStatus": schema_pkg_apis_search_v1alpha1_ResourceRegistryStatus(ref),
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceSelector": schema_pkg_apis_search_v1alpha1_ResourceSelector(ref),
"github.com/karmada-io/karmada/pkg/apis/work/v1alpha1.AggregatedStatusItem": schema_pkg_apis_work_v1alpha1_AggregatedStatusItem(ref),
"github.com/karmada-io/karmada/pkg/apis/work/v1alpha1.ClusterResourceBinding": schema_pkg_apis_work_v1alpha1_ClusterResourceBinding(ref),
"github.com/karmada-io/karmada/pkg/apis/work/v1alpha1.ClusterResourceBindingList": schema_pkg_apis_work_v1alpha1_ClusterResourceBindingList(ref),
@ -2971,6 +2978,308 @@ func schema_pkg_apis_policy_v1alpha1_StaticClusterWeight(ref common.ReferenceCal
}
}
func schema_pkg_apis_search_v1alpha1_ClusterSelector(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "ClusterSelector represents the filter to select clusters.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"labelSelector": {
SchemaProps: spec.SchemaProps{
Description: "LabelSelector is a filter to select member clusters by labels. If non-nil and non-empty, only the clusters match this filter will be selected.",
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"),
},
},
"fieldSelector": {
SchemaProps: spec.SchemaProps{
Description: "FieldSelector is a filter to select member clusters by fields. If non-nil and non-empty, only the clusters match this filter will be selected.",
Ref: ref("github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.FieldSelector"),
},
},
"clusterNames": {
SchemaProps: spec.SchemaProps{
Description: "ClusterNames is the list of clusters to be selected.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
},
},
"exclude": {
SchemaProps: spec.SchemaProps{
Description: "ExcludedClusters is the list of clusters to be ignored.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
},
},
},
},
},
Dependencies: []string{
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.FieldSelector", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"},
}
}
func schema_pkg_apis_search_v1alpha1_FieldSelector(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "FieldSelector is a field filter.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"matchExpressions": {
SchemaProps: spec.SchemaProps{
Description: "A list of field selector requirements.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"),
},
},
},
},
},
},
},
},
Dependencies: []string{
"k8s.io/api/core/v1.NodeSelectorRequirement"},
}
}
func schema_pkg_apis_search_v1alpha1_ResourceRegistry(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "ResourceRegistry defines a list of member cluster to be cached.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
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{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
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{"string"},
Format: "",
},
},
"metadata": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
},
},
"spec": {
SchemaProps: spec.SchemaProps{
Description: "Spec represents the desired behavior of ResourceRegistry.",
Default: map[string]interface{}{},
Ref: ref("github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistrySpec"),
},
},
"status": {
SchemaProps: spec.SchemaProps{
Description: "Status represents the status of ResoruceRegistry.",
Default: map[string]interface{}{},
Ref: ref("github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistryStatus"),
},
},
},
},
},
Dependencies: []string{
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistrySpec", "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistryStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_search_v1alpha1_ResourceRegistryList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "ResourceRegistryList if a collection of ResourceRegistry.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
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{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
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{"string"},
Format: "",
},
},
"metadata": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
},
},
"items": {
SchemaProps: spec.SchemaProps{
Description: "Items holds a list of ResourceRegistry.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistry"),
},
},
},
},
},
},
Required: []string{"items"},
},
},
Dependencies: []string{
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceRegistry", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_search_v1alpha1_ResourceRegistrySpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "ResourceRegistrySpec defines the desired state of ResourceRegistry.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"clusterSelectors": {
SchemaProps: spec.SchemaProps{
Description: "ClusterSelectors represents the filter to select clusters.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ClusterSelector"),
},
},
},
},
},
"resourceSelectors": {
SchemaProps: spec.SchemaProps{
Description: "ResourceSelectors used to select resources.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceSelector"),
},
},
},
},
},
"statusUpdatePeriodSeconds": {
SchemaProps: spec.SchemaProps{
Description: "StatusUpdatePeriodSeconds is the period to update the status of the resource. default is 10s.",
Type: []string{"integer"},
Format: "int64",
},
},
},
Required: []string{"clusterSelectors", "resourceSelectors"},
},
},
Dependencies: []string{
"github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ClusterSelector", "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1.ResourceSelector"},
}
}
func schema_pkg_apis_search_v1alpha1_ResourceRegistryStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "ResourceRegistryStatus defines the observed state of ResourceRegistry",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"conditions": {
SchemaProps: spec.SchemaProps{
Description: "Conditions contain the different condition statuses.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"),
},
},
},
},
},
},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/apis/meta/v1.Condition"},
}
}
func schema_pkg_apis_search_v1alpha1_ResourceSelector(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "ResourceSelector the resources will be selected.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"apiVersion": {
SchemaProps: spec.SchemaProps{
Description: "APIVersion represents the API version of the target resources.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"kind": {
SchemaProps: spec.SchemaProps{
Description: "Kind represents the Kind of the target resources.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"namespace": {
SchemaProps: spec.SchemaProps{
Description: "Namespace of the target resource. Default is empty, which means all namespaces.",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"apiVersion", "kind"},
},
},
}
}
func schema_pkg_apis_work_v1alpha1_AggregatedStatusItem(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{