add karmada operator apis
Signed-off-by: calvin0327 <wen.chen@daocloud.io> Co-Authored-By: carlory <baofa.fan@daocloud.io> Co-Authored-By: chaunceyjiang <chaunceyjiang@gmail.com> Co-Authored-By: lixingchenDaoCloud <89956700+lixingchenDaoCloud@users.noreply.github.com> Co-Authored-By: wawa0210 <xiao.zhang@daocloud.io>
This commit is contained in:
parent
37cca1cd8d
commit
49b71d3826
|
@ -81,6 +81,11 @@ deepcopy-gen \
|
|||
--input-dirs=github.com/karmada-io/karmada/pkg/apis/search \
|
||||
--output-package=github.com/karmada-io/karmada/pkg/apis/search \
|
||||
--output-file-base=zz_generated.deepcopy
|
||||
deepcopy-gen \
|
||||
--go-header-file hack/boilerplate/boilerplate.go.txt \
|
||||
--input-dirs=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--output-package=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--output-file-base=zz_generated.deepcopy
|
||||
|
||||
echo "Generating with register-gen"
|
||||
register-gen \
|
||||
|
@ -123,6 +128,11 @@ register-gen \
|
|||
--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
|
||||
register-gen \
|
||||
--go-header-file hack/boilerplate/boilerplate.go.txt \
|
||||
--input-dirs=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--output-package=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--output-file-base=zz_generated.register
|
||||
|
||||
echo "Generating with conversion-gen"
|
||||
conversion-gen \
|
||||
|
@ -143,12 +153,22 @@ client-gen \
|
|||
--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
|
||||
client-gen \
|
||||
--go-header-file hack/boilerplate/boilerplate.go.txt \
|
||||
--input-base="" \
|
||||
--input=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--output-package=github.com/karmada-io/karmada/operator/pkg/generated/clientset \
|
||||
--clientset-name=versioned
|
||||
|
||||
echo "Generating with 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,github.com/karmada-io/karmada/pkg/apis/search/v1alpha1 \
|
||||
--output-package=github.com/karmada-io/karmada/pkg/generated/listers
|
||||
lister-gen \
|
||||
--go-header-file hack/boilerplate/boilerplate.go.txt \
|
||||
--input-dirs=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--output-package=github.com/karmada-io/karmada/operator/pkg/generated/listers
|
||||
|
||||
echo "Generating with informer-gen"
|
||||
informer-gen \
|
||||
|
@ -157,6 +177,12 @@ informer-gen \
|
|||
--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
|
||||
informer-gen \
|
||||
--go-header-file hack/boilerplate/boilerplate.go.txt \
|
||||
--input-dirs=github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1 \
|
||||
--versioned-clientset-package=github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned \
|
||||
--listers-package=github.com/karmada-io/karmada/operator/pkg/generated/listers \
|
||||
--output-package=github.com/karmada-io/karmada/operator/pkg/generated/informers
|
||||
|
||||
echo "Generating with openapi-gen"
|
||||
openapi-gen \
|
||||
|
|
|
@ -18,3 +18,4 @@ controller-gen crd paths=./pkg/apis/policy/... output:crd:dir=./charts/karmada/_
|
|||
controller-gen crd paths=./pkg/apis/work/... output:crd:dir=./charts/karmada/_crds/bases
|
||||
controller-gen crd paths=./pkg/apis/networking/... output:crd:dir=./charts/karmada/_crds/bases
|
||||
controller-gen crd paths=./examples/customresourceinterpreter/apis/... output:crd:dir=./examples/customresourceinterpreter/apis/
|
||||
controller-gen crd paths=./operator/pkg/apis/operator/... output:crd:dir=./operator/config/crds
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,4 @@
|
|||
// +k8s:deepcopy-gen=package
|
||||
// +groupName=operator.karmada.io
|
||||
|
||||
package v1alpha1
|
|
@ -0,0 +1,612 @@
|
|||
/*
|
||||
Copyright 2022 The Karmada Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:path=karmadas,scope=Namespaced,categories={karmada-io}
|
||||
// +kubebuilder:printcolumn:JSONPath=`.status.controlPlaneReady`,name="Status",type=string
|
||||
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date
|
||||
|
||||
// Karmada enables declarative installation of karmada.
|
||||
type Karmada struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// Standard object's metadata.
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
// Spec defines the desired behavior of the Karmada.
|
||||
// +optional
|
||||
Spec KarmadaSpec `json:"spec,omitempty"`
|
||||
|
||||
// Most recently observed status of the Karmada.
|
||||
// +optional
|
||||
Status KarmadaStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaSpec is the specification of the desired behavior of the Karmada.
|
||||
type KarmadaSpec struct {
|
||||
// HostCluster represents the cluster where to install the Karmada control plane.
|
||||
// If not set, the control plane will be installed on the cluster where
|
||||
// running the operator.
|
||||
// +optional
|
||||
HostCluster *HostCluster `json:"hostCluster,omitempty"`
|
||||
|
||||
// PrivateRegistry is the global image registry.
|
||||
// If set, the operator will pull all required images from it, no matter
|
||||
// the image is maintained by Karmada or Kubernetes.
|
||||
// It will be useful for offline installation to specify an accessible registry.
|
||||
// +optional
|
||||
PrivateRegistry *ImageRegistry `json:"privateRegistry,omitempty"`
|
||||
|
||||
// Components define all of karmada components.
|
||||
// not all of these components need to be installed.
|
||||
// +optional
|
||||
Components *KarmadaComponents `json:"components,omitempty"`
|
||||
|
||||
// FeatureGates enabled by the user.
|
||||
// - Failover: https://karmada.io/docs/userguide/failover/#failover
|
||||
// - GragscefulEviction: https://karmada.io/docs/userguide/failover/#graceful-eviction-feature
|
||||
// - PropagateDeps: https://karmada.io/docs/userguide/scheduling/propagate-dependencies
|
||||
// - CustomizedClusterResourceModeling: https://karmada.io/docs/userguide/scheduling/cluster-resources#start-to-use-cluster-resource-models
|
||||
// More info: https://github.com/karmada-io/karmada/blob/master/pkg/features/features.go
|
||||
// +optional
|
||||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
}
|
||||
|
||||
// ImageRegistry represents an image registry as well as the
|
||||
// necessary credentials to access with.
|
||||
// Note: Postpone define the credentials to the next release.
|
||||
type ImageRegistry struct {
|
||||
// Registry is the image registry hostname, like:
|
||||
// - docker.io
|
||||
// - fictional.registry.example
|
||||
// +required
|
||||
Registry string `json:"registry"`
|
||||
}
|
||||
|
||||
// KarmadaComponents define all of karmada components.
|
||||
type KarmadaComponents struct {
|
||||
// Etcd holds configuration for etcd.
|
||||
// +required
|
||||
Etcd *Etcd `json:"etcd,omitempty"`
|
||||
|
||||
// KarmadaAPIServer holds settings to kube-apiserver component. Currently, kube-apiserver
|
||||
// is used as the apiserver of karmada. we had the same experience as k8s apiserver.
|
||||
// +optional
|
||||
KarmadaAPIServer *KarmadaAPIServer `json:"karmadaAPIServer,omitempty"`
|
||||
|
||||
// KarmadaAggregratedAPIServer holds settings to karmada-aggregated-apiserver component of the karmada.
|
||||
// +optional
|
||||
KarmadaAggregratedAPIServer *KarmadaAggregratedAPIServer `json:"karmadaAggregratedAPIServer,omitempty"`
|
||||
|
||||
// KubeControllerManager holds settings to kube-controller-manager component of the karmada.
|
||||
// +optional
|
||||
KubeControllerManager *KubeControllerManager `json:"kubeControllerManager,omitempty"`
|
||||
|
||||
// KarmadaControllerManager holds settings to karmada-controller-manager component of the karmada.
|
||||
// +optional
|
||||
KarmadaControllerManager *KarmadaControllerManager `json:"karmadaControllerManager,omitempty"`
|
||||
|
||||
// KarmadaScheduler holds settings to karmada-scheduler component of the karmada.
|
||||
// +optional
|
||||
KarmadaScheduler *KarmadaScheduler `json:"karmadaScheduler,omitempty"`
|
||||
|
||||
// KarmadaWebhook holds settings to karmada-webook component of the karmada.
|
||||
// +optional
|
||||
KarmadaWebhook *KarmadaWebhook `json:"karmadaWebhook,omitempty"`
|
||||
|
||||
// KarmadaDescheduler holds settings to karmada-descheduler component of the karmada.
|
||||
// +optional
|
||||
KarmadaDescheduler *KarmadaDescheduler `json:"KarmadaDescheduler,omitempty"`
|
||||
|
||||
// KarmadaSearch holds settings to karmada search component of the karmada.
|
||||
// +optional
|
||||
KarmadaSearch *KarmadaSearch `json:"karmadaSearch,omitempty"`
|
||||
}
|
||||
|
||||
// Networking contains elements describing cluster's networking configuration
|
||||
type Networking struct {
|
||||
// DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local".
|
||||
// +optional
|
||||
DNSDomain *string `json:"dnsDomain,omitempty"`
|
||||
}
|
||||
|
||||
// Etcd contains elements describing Etcd configuration.
|
||||
type Etcd struct {
|
||||
// Local provides configuration knobs for configuring the built-in etcd instance
|
||||
// Local and External are mutually exclusive
|
||||
// +optional
|
||||
Local *LocalEtcd `json:"local,omitempty"`
|
||||
|
||||
// External describes how to connect to an external etcd cluster
|
||||
// Local and External are mutually exclusive
|
||||
// +optional
|
||||
External *ExternalEtcd `json:"external,omitempty"`
|
||||
}
|
||||
|
||||
// LocalEtcd describes that operator should run an etcd cluster in a host cluster.
|
||||
type LocalEtcd struct {
|
||||
// ImageMeta allows to customize the container used for etcd
|
||||
Image `json:",inline"`
|
||||
|
||||
// VolumeData describes the settings of etcd data store.
|
||||
// We will support 3 modes: emtydir, hostPath, PVC. default by hostPath.
|
||||
// +optional
|
||||
VolumeData *VolumeData `json:"volumeData,omitempty"`
|
||||
|
||||
// ServerCertSANs sets extra Subject Alternative Names for the etcd server signing cert.
|
||||
// +optional
|
||||
ServerCertSANs []string `json:"serverCertSANs,omitempty"`
|
||||
|
||||
// PeerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert.
|
||||
// +optional
|
||||
PeerCertSANs []string `json:"peerCertSANs,omitempty"`
|
||||
}
|
||||
|
||||
// VolumeData describes the settings of etcd data store.
|
||||
type VolumeData struct {
|
||||
// The specification for the PersistentVolumeClaim. The entire content is
|
||||
// copied unchanged into the PVC that gets created from this
|
||||
// template. The same fields as in a PersistentVolumeClaim
|
||||
// are also valid here.
|
||||
// +optional
|
||||
VolumeClaim *corev1.PersistentVolumeClaimTemplate `json:"volumeClaim,omitempty"`
|
||||
|
||||
// HostPath represents a pre-existing file or directory on the host
|
||||
// machine that is directly exposed to the container. This is generally
|
||||
// used for system agents or other privileged things that are allowed
|
||||
// to see the host machine. Most containers will NOT need this.
|
||||
// More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
|
||||
// ---
|
||||
// TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
|
||||
// mount host directories as read/write.
|
||||
// +optional
|
||||
HostPath *corev1.HostPathVolumeSource `json:"hostPath,omitempty"`
|
||||
|
||||
// EmptyDir represents a temporary directory that shares a pod's lifetime.
|
||||
// More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
|
||||
// +optional
|
||||
EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`
|
||||
}
|
||||
|
||||
// ExternalEtcd describes an external etcd cluster.
|
||||
// operator has no knowledge of where certificate files live and they must be supplied.
|
||||
type ExternalEtcd struct {
|
||||
// Endpoints of etcd members. Required for ExternalEtcd.
|
||||
Endpoints []string `json:"endpoints"`
|
||||
|
||||
// CAData is an SSL Certificate Authority file used to secure etcd communication.
|
||||
// Required if using a TLS connection.
|
||||
CAData []byte `json:"caData"`
|
||||
|
||||
// CertData is an SSL certification file used to secure etcd communication.
|
||||
// Required if using a TLS connection.
|
||||
CertData []byte `json:"certData"`
|
||||
|
||||
// KeyData is an SSL key file used to secure etcd communication.
|
||||
// Required if using a TLS connection.
|
||||
KeyData []byte `json:"keyData"`
|
||||
}
|
||||
|
||||
// KarmadaAPIServer holds settings to kube-apiserver component of the kubernetes.
|
||||
// Karmada uses it as it's own apiserver in order to provide Kubernetes-native APIs.
|
||||
type KarmadaAPIServer struct {
|
||||
// CommonSettings holds common settings to kubernetes api server.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// ServiceSubnet is the subnet used by k8s services. Defaults to "10.96.0.0/12".
|
||||
// +optional
|
||||
ServiceSubnet *string `json:"serviceSubnet,omitempty"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the kube-apiserver component or
|
||||
// override. A key in this map is the flag name as it appears on the command line except
|
||||
// without leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the
|
||||
// kube-apiserver component. In the future, we will provide a more structured way
|
||||
// to configure the component. Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
|
||||
// CertSANs sets extra Subject Alternative Names for the API Server signing cert.
|
||||
// +optional
|
||||
CertSANs []string `json:"certSANs,omitempty"`
|
||||
|
||||
// FeatureGates enabled by the user.
|
||||
// More info: https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
|
||||
// +optional
|
||||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaAggregratedAPIServer holds settings to karmada-aggregated-apiserver component of the karmada.
|
||||
type KarmadaAggregratedAPIServer struct {
|
||||
// CommonSettings holds common settings to karmada apiServer.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the karmada-aggregated-apiserver component or
|
||||
// override. A key in this map is the flag name as it appears on the command line except
|
||||
// without leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the
|
||||
// karmada-aggregated-apiserver component. In the future, we will provide a more structured way
|
||||
// to configure the component. Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://github.com/karmada-io/karmada/blob/master/cmd/aggregated-apiserver/app/options/options.go
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
|
||||
// CertSANs sets extra Subject Alternative Names for the API Server signing cert.
|
||||
// +optional
|
||||
CertSANs []string `json:"certSANs,omitempty"`
|
||||
|
||||
// ServiceType represents the service type of karmada apiserver.
|
||||
// it is Nodeport by default.
|
||||
// +optional
|
||||
ServiceType corev1.ServiceType `json:"serviceType,omitempty"`
|
||||
|
||||
// FeatureGates enabled by the user.
|
||||
// - CustomizedClusterResourceModeling: https://karmada.io/docs/userguide/scheduling/cluster-resources#start-to-use-cluster-resource-models
|
||||
// More info: https://github.com/karmada-io/karmada/blob/master/pkg/features/features.go
|
||||
// +optional
|
||||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
}
|
||||
|
||||
// KubeControllerManager holds settings to kube-controller-manager component of the kubernetes.
|
||||
// Karmada uses it to manage the lifecycle of the federated resources. An especial case is the garbage
|
||||
// collection of the orphan resources in your karmada.
|
||||
type KubeControllerManager struct {
|
||||
// CommonSettings holds common settings to kubernetes controller manager.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// A list of controllers to enable. '*' enables all on-by-default controllers,
|
||||
// 'foo' enables the controller named 'foo', '-foo' disables the controller named
|
||||
// 'foo'.
|
||||
//
|
||||
// All controllers: attachdetach, bootstrapsigner, cloud-node-lifecycle,
|
||||
// clusterrole-aggregation, cronjob, csrapproving, csrcleaner, csrsigning,
|
||||
// daemonset, deployment, disruption, endpoint, endpointslice,
|
||||
// endpointslicemirroring, ephemeral-volume, garbagecollector,
|
||||
// horizontalpodautoscaling, job, namespace, nodeipam, nodelifecycle,
|
||||
// persistentvolume-binder, persistentvolume-expander, podgc, pv-protection,
|
||||
// pvc-protection, replicaset, replicationcontroller, resourcequota,
|
||||
// root-ca-cert-publisher, route, service, serviceaccount, serviceaccount-token,
|
||||
// statefulset, tokencleaner, ttl, ttl-after-finished
|
||||
// Disabled-by-default controllers: bootstrapsigner, tokencleaner (default [*])
|
||||
// Actual Supported controllers depend on the version of Kubernetes. See
|
||||
// https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
|
||||
// for details.
|
||||
//
|
||||
// However, Karmada uses Kubernetes Native API definitions for federated resource template,
|
||||
// so it doesn't need enable some resource related controllers like daemonset, deployment etc.
|
||||
// On the other hand, Karmada leverages the capabilities of the Kubernetes controller to
|
||||
// manage the lifecycle of the federated resource, so it needs to enable some controllers.
|
||||
// For example, the `namespace` controller is used to manage the lifecycle of the namespace
|
||||
// and the `garbagecollector` controller handles automatic clean-up of redundant items in
|
||||
// your karmada.
|
||||
//
|
||||
// According to the user feedback and karmada requirements, the following controllers are
|
||||
// enabled by default: namespace, garbagecollector, serviceaccount-token, ttl-after-finished,
|
||||
// bootstrapsigner,csrapproving,csrcleaner,csrsigning. See
|
||||
// https://karmada.io/docs/administrator/configuration/configure-controllers#kubernetes-controllers
|
||||
//
|
||||
// Others are disabled by default. If you want to enable or disable other controllers, you
|
||||
// have to explicitly specify all the controllers that kube-controller-manager shoud enable
|
||||
// at startup phase.
|
||||
// +optional
|
||||
Controllers []string `json:"controllers,omitempty"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the kube-controller-manager component or
|
||||
// override. A key in this map is the flag name as it appears on the command line except
|
||||
// without leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the
|
||||
// kube-controller-manager component. In the future, we will provide a more structured way
|
||||
// to configure the component. Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
|
||||
// FeatureGates enabled by the user.
|
||||
// More info: https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
|
||||
// +optional
|
||||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaControllerManager holds settings to the karmada-controller-manager component of the karmada.
|
||||
type KarmadaControllerManager struct {
|
||||
// CommonSettings holds common settings to karmada controller manager.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// A list of controllers to enable. '*' enables all on-by-default controllers,
|
||||
// 'foo' enables the controller named 'foo', '-foo' disables the controller named
|
||||
// 'foo'.
|
||||
//
|
||||
// All controllers: binding, cluster, clusterStatus, endpointSlice, execution,
|
||||
// federatedResourceQuotaStatus, federatedResourceQuotaSync, hpa, namespace,
|
||||
// serviceExport, serviceImport, unifiedAuth, workStatus.
|
||||
// Disabled-by-default controllers: hpa (default [*])
|
||||
// Actual Supported controllers depend on the version of Karmada. See
|
||||
// https://karmada.io/docs/administrator/configuration/configure-controllers#configure-karmada-controllers
|
||||
// for details.
|
||||
//
|
||||
// +optional
|
||||
Controllers []string `json:"controllers,omitempty"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the karmada-controller-manager component or
|
||||
// override. A key in this map is the flag name as it appears on the command line except
|
||||
// without leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the
|
||||
// karmada-controller-manager component. In the future, we will provide a more structured way
|
||||
// to configure the component. Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://github.com/karmada-io/karmada/blob/master/cmd/controller-manager/app/options/options.go
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
|
||||
// FeatureGates enabled by the user.
|
||||
// - Failover: https://karmada.io/docs/userguide/failover/#failover
|
||||
// - GracefulEviction: https://karmada.io/docs/userguide/failover/#graceful-eviction-feature
|
||||
// - PropagateDeps: https://karmada.io/docs/userguide/scheduling/propagate-dependencies
|
||||
// - CustomizedClusterResourceModeling: https://karmada.io/docs/userguide/scheduling/cluster-resources#start-to-use-cluster-resource-models
|
||||
// More info: https://github.com/karmada-io/karmada/blob/master/pkg/features/features.go
|
||||
// +optional
|
||||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaScheduler holds settings to karmada-scheduler component of the karmada.
|
||||
type KarmadaScheduler struct {
|
||||
// CommonSettings holds common settings to karmada scheduler.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the karmada-scheduler component or override.
|
||||
// A key in this map is the flag name as it appears on the command line except without
|
||||
// leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the karmada-scheduler
|
||||
// component. In the future, we will provide a more structured way to configure the component.
|
||||
// Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://github.com/karmada-io/karmada/blob/master/cmd/scheduler/app/options/options.go
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
|
||||
// FeatureGates enabled by the user.
|
||||
// - CustomizedClusterResourceModeling: https://karmada.io/docs/userguide/scheduling/cluster-resources#start-to-use-cluster-resource-models
|
||||
// More info: https://github.com/karmada-io/karmada/blob/master/pkg/features/features.go
|
||||
// +optional
|
||||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaDescheduler holds settings to karmada-descheduler component of the karmada.
|
||||
type KarmadaDescheduler struct {
|
||||
// CommonSettings holds common settings to karmada descheduler.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the karmada-descheduler component or override.
|
||||
// A key in this map is the flag name as it appears on the command line except without
|
||||
// leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the karmada-descheduler
|
||||
// component. In the future, we will provide a more structured way to configure the component.
|
||||
// Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://github.com/karmada-io/karmada/blob/master/cmd/descheduler/app/options/options.go
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaSearch holds settings to karmada-search component of the karmada.
|
||||
type KarmadaSearch struct {
|
||||
// CommonSettings holds common settings to karmada search.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the karmada-descheduler component or override.
|
||||
// A key in this map is the flag name as it appears on the command line except without
|
||||
// leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the karmada-descheduler
|
||||
// component. In the future, we will provide a more structured way to configure the component.
|
||||
// Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://github.com/karmada-io/karmada/blob/master/cmd/descheduler/app/options/options.go
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
}
|
||||
|
||||
// KarmadaWebhook holds settings to karmada-webhook component of the karmada.
|
||||
type KarmadaWebhook struct {
|
||||
// CommonSettings holds common settings to karmada webhook.
|
||||
CommonSettings `json:",inline"`
|
||||
|
||||
// ExtraArgs is an extra set of flags to pass to the karmada-webhook component or
|
||||
// override. A key in this map is the flag name as it appears on the command line except
|
||||
// without leading dash(es).
|
||||
//
|
||||
// Note: This is a temporary solution to allow for the configuration of the
|
||||
// karmada-webhook component. In the future, we will provide a more structured way
|
||||
// to configure the component. Once that is done, this field will be discouraged to be used.
|
||||
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
|
||||
// state. Before you do it, please confirm that you understand the risks of this configuration.
|
||||
//
|
||||
// For supported flags, please see
|
||||
// https://github.com/karmada-io/karmada/blob/master/cmd/webhook/app/options/options.go
|
||||
// for details.
|
||||
// +optional
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
}
|
||||
|
||||
// CommonSettings describes the common settings of all karmada Components.
|
||||
type CommonSettings struct {
|
||||
// Image allows to customize the image used for the component.
|
||||
Image `json:",inline"`
|
||||
|
||||
// Number of desired pods. This is a pointer to distinguish between explicit
|
||||
// zero and not specified. Defaults to 1.
|
||||
// +optional
|
||||
Replicas *int32 `json:"replicas,omitempty"`
|
||||
|
||||
// Map of string keys and values that can be used to organize and categorize
|
||||
// (scope and select) objects. May match selectors of replication controllers
|
||||
// and services.
|
||||
// More info: http://kubernetes.io/docs/user-guide/labels
|
||||
// +optional
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
||||
// Annotations is an unstructured key value map stored with a resource that may be
|
||||
// set by external tools to store and retrieve arbitrary metadata. They are not
|
||||
// queryable and should be preserved when modifying objects.
|
||||
// More info: http://kubernetes.io/docs/user-guide/annotations
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
|
||||
// Compute Resources required by this component.
|
||||
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
|
||||
// +optional
|
||||
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
// Image allows to customize the image used for components.
|
||||
type Image struct {
|
||||
// ImageRepository sets the container registry to pull images from.
|
||||
// if not set, the ImageRepository defined in KarmadaSpec will be used instead.
|
||||
// +optional
|
||||
ImageRepository string `json:"imageRepository,omitempty"`
|
||||
|
||||
// ImageTag allows to specify a tag for the image.
|
||||
// In case this value is set, operator does not change automatically the version
|
||||
// of the above components during upgrades.
|
||||
// +optional
|
||||
ImageTag string `json:"imageTag,omitempty"`
|
||||
}
|
||||
|
||||
// HostCluster represents the cluster where to install the Karmada control plane.
|
||||
type HostCluster struct {
|
||||
// APIEndpoint is the API endpoint of the cluster where deploy Karmada
|
||||
// control plane on.
|
||||
// This can be a hostname, hostname:port, IP or IP:port.
|
||||
// +optional
|
||||
APIEndpoint string `json:"apiEndpoint,omitempty"`
|
||||
|
||||
// SecretRef represents the secret contains mandatory credentials to
|
||||
// access the cluster.
|
||||
// The secret should hold credentials as follows:
|
||||
// - secret.data.token
|
||||
// - secret.data.caBundle
|
||||
// +optional
|
||||
SecretRef *LocalSecretReference `json:"secretRef,omitempty"`
|
||||
|
||||
// Networking holds configuration for the networking topology of the cluster.
|
||||
// +optional
|
||||
Networking *Networking `json:"networking,omitempty"`
|
||||
}
|
||||
|
||||
// ConditionType declarative karmada condition type of karmada installtion.
|
||||
type ConditionType string
|
||||
|
||||
const (
|
||||
// Unknown represent a condition type the karmada not be reconciled by operator
|
||||
// or unpredictable condition.
|
||||
Unknown ConditionType = "Unknown"
|
||||
|
||||
// Ready represent a condition type the all installtion process to karmada have compaleted.
|
||||
Ready ConditionType = "Ready"
|
||||
)
|
||||
|
||||
// KarmadaStatus difine the most recently observed status of the Karmada.
|
||||
type KarmadaStatus struct {
|
||||
// ObservedGeneration is the last observed generation.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||
|
||||
// after the karmada installed, restore the kubeconfig to secret.
|
||||
// +optional
|
||||
SecretRef *LocalSecretReference `json:"secretRef,omitempty"`
|
||||
|
||||
// KarmadaVersion represente the karmada version.
|
||||
// +optional
|
||||
KarmadaVersion string `json:"karmadaVersion,omitempty"`
|
||||
|
||||
// KubernetesVersion represente the karmada-apiserver version.
|
||||
// +optional
|
||||
KubernetesVersion string `json:"kubernetesVersion,omitempty"`
|
||||
|
||||
// Conditions represents the latest available observations of a karmada's current state.
|
||||
// +optional
|
||||
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// LocalSecretReference is a reference to a secret within the enclosing
|
||||
// namespace.
|
||||
type LocalSecretReference struct {
|
||||
// Namespace is the namespace for the resource being referenced.
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// Name is the name of resource being referenced.
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// KarmadaList is a list of Karmadas.
|
||||
type KarmadaList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// +optional
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
|
||||
Items []Karmada `json:"items"`
|
||||
}
|
|
@ -0,0 +1,709 @@
|
|||
//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 *CommonSettings) DeepCopyInto(out *CommonSettings) {
|
||||
*out = *in
|
||||
out.Image = in.Image
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonSettings.
|
||||
func (in *CommonSettings) DeepCopy() *CommonSettings {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CommonSettings)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Etcd) DeepCopyInto(out *Etcd) {
|
||||
*out = *in
|
||||
if in.Local != nil {
|
||||
in, out := &in.Local, &out.Local
|
||||
*out = new(LocalEtcd)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(ExternalEtcd)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Etcd.
|
||||
func (in *Etcd) DeepCopy() *Etcd {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Etcd)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ExternalEtcd) DeepCopyInto(out *ExternalEtcd) {
|
||||
*out = *in
|
||||
if in.Endpoints != nil {
|
||||
in, out := &in.Endpoints, &out.Endpoints
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.CAData != nil {
|
||||
in, out := &in.CAData, &out.CAData
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.CertData != nil {
|
||||
in, out := &in.CertData, &out.CertData
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.KeyData != nil {
|
||||
in, out := &in.KeyData, &out.KeyData
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalEtcd.
|
||||
func (in *ExternalEtcd) DeepCopy() *ExternalEtcd {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ExternalEtcd)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HostCluster) DeepCopyInto(out *HostCluster) {
|
||||
*out = *in
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(LocalSecretReference)
|
||||
**out = **in
|
||||
}
|
||||
if in.Networking != nil {
|
||||
in, out := &in.Networking, &out.Networking
|
||||
*out = new(Networking)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostCluster.
|
||||
func (in *HostCluster) DeepCopy() *HostCluster {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HostCluster)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Image) DeepCopyInto(out *Image) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image.
|
||||
func (in *Image) DeepCopy() *Image {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Image)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImageRegistry) DeepCopyInto(out *ImageRegistry) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageRegistry.
|
||||
func (in *ImageRegistry) DeepCopy() *ImageRegistry {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImageRegistry)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Karmada) DeepCopyInto(out *Karmada) {
|
||||
*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 Karmada.
|
||||
func (in *Karmada) DeepCopy() *Karmada {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Karmada)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Karmada) 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 *KarmadaAPIServer) DeepCopyInto(out *KarmadaAPIServer) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.ServiceSubnet != nil {
|
||||
in, out := &in.ServiceSubnet, &out.ServiceSubnet
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.CertSANs != nil {
|
||||
in, out := &in.CertSANs, &out.CertSANs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.FeatureGates != nil {
|
||||
in, out := &in.FeatureGates, &out.FeatureGates
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaAPIServer.
|
||||
func (in *KarmadaAPIServer) DeepCopy() *KarmadaAPIServer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaAPIServer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaAggregratedAPIServer) DeepCopyInto(out *KarmadaAggregratedAPIServer) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.CertSANs != nil {
|
||||
in, out := &in.CertSANs, &out.CertSANs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.FeatureGates != nil {
|
||||
in, out := &in.FeatureGates, &out.FeatureGates
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaAggregratedAPIServer.
|
||||
func (in *KarmadaAggregratedAPIServer) DeepCopy() *KarmadaAggregratedAPIServer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaAggregratedAPIServer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaComponents) DeepCopyInto(out *KarmadaComponents) {
|
||||
*out = *in
|
||||
if in.Etcd != nil {
|
||||
in, out := &in.Etcd, &out.Etcd
|
||||
*out = new(Etcd)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaAPIServer != nil {
|
||||
in, out := &in.KarmadaAPIServer, &out.KarmadaAPIServer
|
||||
*out = new(KarmadaAPIServer)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaAggregratedAPIServer != nil {
|
||||
in, out := &in.KarmadaAggregratedAPIServer, &out.KarmadaAggregratedAPIServer
|
||||
*out = new(KarmadaAggregratedAPIServer)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KubeControllerManager != nil {
|
||||
in, out := &in.KubeControllerManager, &out.KubeControllerManager
|
||||
*out = new(KubeControllerManager)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaControllerManager != nil {
|
||||
in, out := &in.KarmadaControllerManager, &out.KarmadaControllerManager
|
||||
*out = new(KarmadaControllerManager)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaScheduler != nil {
|
||||
in, out := &in.KarmadaScheduler, &out.KarmadaScheduler
|
||||
*out = new(KarmadaScheduler)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaWebhook != nil {
|
||||
in, out := &in.KarmadaWebhook, &out.KarmadaWebhook
|
||||
*out = new(KarmadaWebhook)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaDescheduler != nil {
|
||||
in, out := &in.KarmadaDescheduler, &out.KarmadaDescheduler
|
||||
*out = new(KarmadaDescheduler)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.KarmadaSearch != nil {
|
||||
in, out := &in.KarmadaSearch, &out.KarmadaSearch
|
||||
*out = new(KarmadaSearch)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaComponents.
|
||||
func (in *KarmadaComponents) DeepCopy() *KarmadaComponents {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaComponents)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaControllerManager) DeepCopyInto(out *KarmadaControllerManager) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.Controllers != nil {
|
||||
in, out := &in.Controllers, &out.Controllers
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.FeatureGates != nil {
|
||||
in, out := &in.FeatureGates, &out.FeatureGates
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaControllerManager.
|
||||
func (in *KarmadaControllerManager) DeepCopy() *KarmadaControllerManager {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaControllerManager)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaDescheduler) DeepCopyInto(out *KarmadaDescheduler) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaDescheduler.
|
||||
func (in *KarmadaDescheduler) DeepCopy() *KarmadaDescheduler {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaDescheduler)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaList) DeepCopyInto(out *KarmadaList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Karmada, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaList.
|
||||
func (in *KarmadaList) DeepCopy() *KarmadaList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *KarmadaList) 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 *KarmadaScheduler) DeepCopyInto(out *KarmadaScheduler) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.FeatureGates != nil {
|
||||
in, out := &in.FeatureGates, &out.FeatureGates
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaScheduler.
|
||||
func (in *KarmadaScheduler) DeepCopy() *KarmadaScheduler {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaScheduler)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaSearch) DeepCopyInto(out *KarmadaSearch) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaSearch.
|
||||
func (in *KarmadaSearch) DeepCopy() *KarmadaSearch {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaSearch)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaSpec) DeepCopyInto(out *KarmadaSpec) {
|
||||
*out = *in
|
||||
if in.HostCluster != nil {
|
||||
in, out := &in.HostCluster, &out.HostCluster
|
||||
*out = new(HostCluster)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PrivateRegistry != nil {
|
||||
in, out := &in.PrivateRegistry, &out.PrivateRegistry
|
||||
*out = new(ImageRegistry)
|
||||
**out = **in
|
||||
}
|
||||
if in.Components != nil {
|
||||
in, out := &in.Components, &out.Components
|
||||
*out = new(KarmadaComponents)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.FeatureGates != nil {
|
||||
in, out := &in.FeatureGates, &out.FeatureGates
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaSpec.
|
||||
func (in *KarmadaSpec) DeepCopy() *KarmadaSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaStatus) DeepCopyInto(out *KarmadaStatus) {
|
||||
*out = *in
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(LocalSecretReference)
|
||||
**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 KarmadaStatus.
|
||||
func (in *KarmadaStatus) DeepCopy() *KarmadaStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KarmadaWebhook) DeepCopyInto(out *KarmadaWebhook) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KarmadaWebhook.
|
||||
func (in *KarmadaWebhook) DeepCopy() *KarmadaWebhook {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KarmadaWebhook)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KubeControllerManager) DeepCopyInto(out *KubeControllerManager) {
|
||||
*out = *in
|
||||
in.CommonSettings.DeepCopyInto(&out.CommonSettings)
|
||||
if in.Controllers != nil {
|
||||
in, out := &in.Controllers, &out.Controllers
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.ExtraArgs != nil {
|
||||
in, out := &in.ExtraArgs, &out.ExtraArgs
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.FeatureGates != nil {
|
||||
in, out := &in.FeatureGates, &out.FeatureGates
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeControllerManager.
|
||||
func (in *KubeControllerManager) DeepCopy() *KubeControllerManager {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KubeControllerManager)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LocalEtcd) DeepCopyInto(out *LocalEtcd) {
|
||||
*out = *in
|
||||
out.Image = in.Image
|
||||
if in.VolumeData != nil {
|
||||
in, out := &in.VolumeData, &out.VolumeData
|
||||
*out = new(VolumeData)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ServerCertSANs != nil {
|
||||
in, out := &in.ServerCertSANs, &out.ServerCertSANs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.PeerCertSANs != nil {
|
||||
in, out := &in.PeerCertSANs, &out.PeerCertSANs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalEtcd.
|
||||
func (in *LocalEtcd) DeepCopy() *LocalEtcd {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LocalEtcd)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalSecretReference.
|
||||
func (in *LocalSecretReference) DeepCopy() *LocalSecretReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LocalSecretReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Networking) DeepCopyInto(out *Networking) {
|
||||
*out = *in
|
||||
if in.DNSDomain != nil {
|
||||
in, out := &in.DNSDomain, &out.DNSDomain
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networking.
|
||||
func (in *Networking) DeepCopy() *Networking {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Networking)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeData) DeepCopyInto(out *VolumeData) {
|
||||
*out = *in
|
||||
if in.VolumeClaim != nil {
|
||||
in, out := &in.VolumeClaim, &out.VolumeClaim
|
||||
*out = new(corev1.PersistentVolumeClaimTemplate)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.HostPath != nil {
|
||||
in, out := &in.HostPath, &out.HostPath
|
||||
*out = new(corev1.HostPathVolumeSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.EmptyDir != nil {
|
||||
in, out := &in.EmptyDir, &out.EmptyDir
|
||||
*out = new(corev1.EmptyDirVolumeSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeData.
|
||||
func (in *VolumeData) DeepCopy() *VolumeData {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeData)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
|
@ -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 = "operator.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,
|
||||
&Karmada{},
|
||||
&KarmadaList{},
|
||||
)
|
||||
// AddToGroupVersion allows the serialization of client types like ListOptions.
|
||||
v1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package versioned
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
operatorv1alpha1 "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned/typed/operator/v1alpha1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
OperatorV1alpha1() operatorv1alpha1.OperatorV1alpha1Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
// version included in a Clientset.
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
operatorV1alpha1 *operatorv1alpha1.OperatorV1alpha1Client
|
||||
}
|
||||
|
||||
// OperatorV1alpha1 retrieves the OperatorV1alpha1Client
|
||||
func (c *Clientset) OperatorV1alpha1() operatorv1alpha1.OperatorV1alpha1Interface {
|
||||
return c.operatorV1alpha1
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.DiscoveryClient
|
||||
}
|
||||
|
||||
// NewForConfig creates a new Clientset for the given config.
|
||||
// If config's RateLimiter is not set and QPS and Burst are acceptable,
|
||||
// NewForConfig will generate a rate-limiter in configShallowCopy.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
|
||||
if configShallowCopy.UserAgent == "" {
|
||||
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
// share the transport between all clients
|
||||
httpClient, err := rest.HTTPClientFor(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
}
|
||||
|
||||
// NewForConfigAndClient creates a new Clientset for the given config and http client.
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
// If config's RateLimiter is not set and QPS and Burst are acceptable,
|
||||
// NewForConfigAndClient will generate a rate-limiter in configShallowCopy.
|
||||
func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
|
||||
if configShallowCopy.Burst <= 0 {
|
||||
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
|
||||
}
|
||||
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
|
||||
}
|
||||
|
||||
var cs Clientset
|
||||
var err error
|
||||
cs.operatorV1alpha1, err = operatorv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &cs, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new Clientset for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return cs
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c rest.Interface) *Clientset {
|
||||
var cs Clientset
|
||||
cs.operatorV1alpha1 = operatorv1alpha1.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated clientset.
|
||||
package versioned
|
|
@ -0,0 +1,69 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
clientset "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned"
|
||||
operatorv1alpha1 "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned/typed/operator/v1alpha1"
|
||||
fakeoperatorv1alpha1 "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned/typed/operator/v1alpha1/fake"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
fakediscovery "k8s.io/client-go/discovery/fake"
|
||||
"k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
|
||||
// without applying any validations and/or defaults. It shouldn't be considered a replacement
|
||||
// for a real clientset and is mostly useful in simple unit tests.
|
||||
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
|
||||
for _, obj := range objects {
|
||||
if err := o.Add(obj); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
cs := &Clientset{tracker: o}
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
return true, watch, nil
|
||||
})
|
||||
|
||||
return cs
|
||||
}
|
||||
|
||||
// Clientset implements clientset.Interface. Meant to be embedded into a
|
||||
// struct to get a default implementation. This makes faking out just the method
|
||||
// you want to test easier.
|
||||
type Clientset struct {
|
||||
testing.Fake
|
||||
discovery *fakediscovery.FakeDiscovery
|
||||
tracker testing.ObjectTracker
|
||||
}
|
||||
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
return c.discovery
|
||||
}
|
||||
|
||||
func (c *Clientset) Tracker() testing.ObjectTracker {
|
||||
return c.tracker
|
||||
}
|
||||
|
||||
var (
|
||||
_ clientset.Interface = &Clientset{}
|
||||
_ testing.FakeClient = &Clientset{}
|
||||
)
|
||||
|
||||
// OperatorV1alpha1 retrieves the OperatorV1alpha1Client
|
||||
func (c *Clientset) OperatorV1alpha1() operatorv1alpha1.OperatorV1alpha1Interface {
|
||||
return &fakeoperatorv1alpha1.FakeOperatorV1alpha1{Fake: &c.Fake}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated fake clientset.
|
||||
package fake
|
|
@ -0,0 +1,40 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
operatorv1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
)
|
||||
|
||||
var scheme = runtime.NewScheme()
|
||||
var codecs = serializer.NewCodecFactory(scheme)
|
||||
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
operatorv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
var AddToScheme = localSchemeBuilder.AddToScheme
|
||||
|
||||
func init() {
|
||||
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
|
||||
utilruntime.Must(AddToScheme(scheme))
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package contains the scheme of the automatically generated clientset.
|
||||
package scheme
|
|
@ -0,0 +1,40 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package scheme
|
||||
|
||||
import (
|
||||
operatorv1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
)
|
||||
|
||||
var Scheme = runtime.NewScheme()
|
||||
var Codecs = serializer.NewCodecFactory(Scheme)
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
operatorv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
var AddToScheme = localSchemeBuilder.AddToScheme
|
||||
|
||||
func init() {
|
||||
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
|
||||
utilruntime.Must(AddToScheme(Scheme))
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
|
@ -0,0 +1,4 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
|
@ -0,0 +1,126 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/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"
|
||||
)
|
||||
|
||||
// FakeKarmadas implements KarmadaInterface
|
||||
type FakeKarmadas struct {
|
||||
Fake *FakeOperatorV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var karmadasResource = schema.GroupVersionResource{Group: "operator.karmada.io", Version: "v1alpha1", Resource: "karmadas"}
|
||||
|
||||
var karmadasKind = schema.GroupVersionKind{Group: "operator.karmada.io", Version: "v1alpha1", Kind: "Karmada"}
|
||||
|
||||
// Get takes name of the karmada, and returns the corresponding karmada object, and an error if there is any.
|
||||
func (c *FakeKarmadas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Karmada, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(karmadasResource, c.ns, name), &v1alpha1.Karmada{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Karmada), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Karmadas that match those selectors.
|
||||
func (c *FakeKarmadas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.KarmadaList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(karmadasResource, karmadasKind, c.ns, opts), &v1alpha1.KarmadaList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.KarmadaList{ListMeta: obj.(*v1alpha1.KarmadaList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.KarmadaList).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 karmadas.
|
||||
func (c *FakeKarmadas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(karmadasResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a karmada and creates it. Returns the server's representation of the karmada, and an error, if there is any.
|
||||
func (c *FakeKarmadas) Create(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.CreateOptions) (result *v1alpha1.Karmada, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(karmadasResource, c.ns, karmada), &v1alpha1.Karmada{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Karmada), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a karmada and updates it. Returns the server's representation of the karmada, and an error, if there is any.
|
||||
func (c *FakeKarmadas) Update(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.UpdateOptions) (result *v1alpha1.Karmada, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(karmadasResource, c.ns, karmada), &v1alpha1.Karmada{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Karmada), 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 *FakeKarmadas) UpdateStatus(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.UpdateOptions) (*v1alpha1.Karmada, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(karmadasResource, "status", c.ns, karmada), &v1alpha1.Karmada{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Karmada), err
|
||||
}
|
||||
|
||||
// Delete takes name of the karmada and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeKarmadas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(karmadasResource, c.ns, name, opts), &v1alpha1.Karmada{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeKarmadas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(karmadasResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.KarmadaList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched karmada.
|
||||
func (c *FakeKarmadas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Karmada, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(karmadasResource, c.ns, name, pt, data, subresources...), &v1alpha1.Karmada{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Karmada), err
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned/typed/operator/v1alpha1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeOperatorV1alpha1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeOperatorV1alpha1) Karmadas(namespace string) v1alpha1.KarmadaInterface {
|
||||
return &FakeKarmadas{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeOperatorV1alpha1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
type KarmadaExpansion interface{}
|
|
@ -0,0 +1,179 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
scheme "github.com/karmada-io/karmada/operator/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"
|
||||
)
|
||||
|
||||
// KarmadasGetter has a method to return a KarmadaInterface.
|
||||
// A group's client should implement this interface.
|
||||
type KarmadasGetter interface {
|
||||
Karmadas(namespace string) KarmadaInterface
|
||||
}
|
||||
|
||||
// KarmadaInterface has methods to work with Karmada resources.
|
||||
type KarmadaInterface interface {
|
||||
Create(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.CreateOptions) (*v1alpha1.Karmada, error)
|
||||
Update(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.UpdateOptions) (*v1alpha1.Karmada, error)
|
||||
UpdateStatus(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.UpdateOptions) (*v1alpha1.Karmada, 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.Karmada, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.KarmadaList, 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.Karmada, err error)
|
||||
KarmadaExpansion
|
||||
}
|
||||
|
||||
// karmadas implements KarmadaInterface
|
||||
type karmadas struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newKarmadas returns a Karmadas
|
||||
func newKarmadas(c *OperatorV1alpha1Client, namespace string) *karmadas {
|
||||
return &karmadas{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the karmada, and returns the corresponding karmada object, and an error if there is any.
|
||||
func (c *karmadas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Karmada, err error) {
|
||||
result = &v1alpha1.Karmada{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Karmadas that match those selectors.
|
||||
func (c *karmadas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.KarmadaList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.KarmadaList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested karmadas.
|
||||
func (c *karmadas) 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("karmadas").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a karmada and creates it. Returns the server's representation of the karmada, and an error, if there is any.
|
||||
func (c *karmadas) Create(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.CreateOptions) (result *v1alpha1.Karmada, err error) {
|
||||
result = &v1alpha1.Karmada{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(karmada).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a karmada and updates it. Returns the server's representation of the karmada, and an error, if there is any.
|
||||
func (c *karmadas) Update(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.UpdateOptions) (result *v1alpha1.Karmada, err error) {
|
||||
result = &v1alpha1.Karmada{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
Name(karmada.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(karmada).
|
||||
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 *karmadas) UpdateStatus(ctx context.Context, karmada *v1alpha1.Karmada, opts v1.UpdateOptions) (result *v1alpha1.Karmada, err error) {
|
||||
result = &v1alpha1.Karmada{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
Name(karmada.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(karmada).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the karmada and deletes it. Returns an error if one occurs.
|
||||
func (c *karmadas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *karmadas) 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("karmadas").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched karmada.
|
||||
func (c *karmadas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Karmada, err error) {
|
||||
result = &v1alpha1.Karmada{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("karmadas").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
"github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type OperatorV1alpha1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
KarmadasGetter
|
||||
}
|
||||
|
||||
// OperatorV1alpha1Client is used to interact with features provided by the operator.karmada.io group.
|
||||
type OperatorV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *OperatorV1alpha1Client) Karmadas(namespace string) KarmadaInterface {
|
||||
return newKarmadas(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new OperatorV1alpha1Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*OperatorV1alpha1Client, 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 OperatorV1alpha1Client 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) (*OperatorV1alpha1Client, 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 &OperatorV1alpha1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new OperatorV1alpha1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *OperatorV1alpha1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new OperatorV1alpha1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *OperatorV1alpha1Client {
|
||||
return &OperatorV1alpha1Client{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 *OperatorV1alpha1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
time "time"
|
||||
|
||||
versioned "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/karmada-io/karmada/operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
operator "github.com/karmada-io/karmada/operator/pkg/generated/informers/externalversions/operator"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// SharedInformerOption defines the functional option type for SharedInformerFactory.
|
||||
type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory
|
||||
|
||||
type sharedInformerFactory struct {
|
||||
client versioned.Interface
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
lock sync.Mutex
|
||||
defaultResync time.Duration
|
||||
customResync map[reflect.Type]time.Duration
|
||||
|
||||
informers map[reflect.Type]cache.SharedIndexInformer
|
||||
// startedInformers is used for tracking which informers have been started.
|
||||
// This allows Start() to be called multiple times safely.
|
||||
startedInformers map[reflect.Type]bool
|
||||
}
|
||||
|
||||
// WithCustomResyncConfig sets a custom resync period for the specified informer types.
|
||||
func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption {
|
||||
return func(factory *sharedInformerFactory) *sharedInformerFactory {
|
||||
for k, v := range resyncConfig {
|
||||
factory.customResync[reflect.TypeOf(k)] = v
|
||||
}
|
||||
return factory
|
||||
}
|
||||
}
|
||||
|
||||
// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory.
|
||||
func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption {
|
||||
return func(factory *sharedInformerFactory) *sharedInformerFactory {
|
||||
factory.tweakListOptions = tweakListOptions
|
||||
return factory
|
||||
}
|
||||
}
|
||||
|
||||
// WithNamespace limits the SharedInformerFactory to the specified namespace.
|
||||
func WithNamespace(namespace string) SharedInformerOption {
|
||||
return func(factory *sharedInformerFactory) *sharedInformerFactory {
|
||||
factory.namespace = namespace
|
||||
return factory
|
||||
}
|
||||
}
|
||||
|
||||
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces.
|
||||
func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory {
|
||||
return NewSharedInformerFactoryWithOptions(client, defaultResync)
|
||||
}
|
||||
|
||||
// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory.
|
||||
// Listers obtained via this SharedInformerFactory will be subject to the same filters
|
||||
// as specified here.
|
||||
// Deprecated: Please use NewSharedInformerFactoryWithOptions instead
|
||||
func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
|
||||
return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions))
|
||||
}
|
||||
|
||||
// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options.
|
||||
func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory {
|
||||
factory := &sharedInformerFactory{
|
||||
client: client,
|
||||
namespace: v1.NamespaceAll,
|
||||
defaultResync: defaultResync,
|
||||
informers: make(map[reflect.Type]cache.SharedIndexInformer),
|
||||
startedInformers: make(map[reflect.Type]bool),
|
||||
customResync: make(map[reflect.Type]time.Duration),
|
||||
}
|
||||
|
||||
// Apply all options
|
||||
for _, opt := range options {
|
||||
factory = opt(factory)
|
||||
}
|
||||
|
||||
return factory
|
||||
}
|
||||
|
||||
// Start initializes all requested informers.
|
||||
func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
for informerType, informer := range f.informers {
|
||||
if !f.startedInformers[informerType] {
|
||||
go informer.Run(stopCh)
|
||||
f.startedInformers[informerType] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WaitForCacheSync waits for all started informers' cache were synced.
|
||||
func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool {
|
||||
informers := func() map[reflect.Type]cache.SharedIndexInformer {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
informers := map[reflect.Type]cache.SharedIndexInformer{}
|
||||
for informerType, informer := range f.informers {
|
||||
if f.startedInformers[informerType] {
|
||||
informers[informerType] = informer
|
||||
}
|
||||
}
|
||||
return informers
|
||||
}()
|
||||
|
||||
res := map[reflect.Type]bool{}
|
||||
for informType, informer := range informers {
|
||||
res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
|
||||
// client.
|
||||
func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
informerType := reflect.TypeOf(obj)
|
||||
informer, exists := f.informers[informerType]
|
||||
if exists {
|
||||
return informer
|
||||
}
|
||||
|
||||
resyncPeriod, exists := f.customResync[informerType]
|
||||
if !exists {
|
||||
resyncPeriod = f.defaultResync
|
||||
}
|
||||
|
||||
informer = newFunc(f.client, resyncPeriod)
|
||||
f.informers[informerType] = informer
|
||||
|
||||
return informer
|
||||
}
|
||||
|
||||
// SharedInformerFactory provides shared informers for resources in all known
|
||||
// API group versions.
|
||||
type SharedInformerFactory interface {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
|
||||
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
|
||||
|
||||
Operator() operator.Interface
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Operator() operator.Interface {
|
||||
return operator.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
|
||||
// sharedInformers based on type
|
||||
type GenericInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() cache.GenericLister
|
||||
}
|
||||
|
||||
type genericInformer struct {
|
||||
informer cache.SharedIndexInformer
|
||||
resource schema.GroupResource
|
||||
}
|
||||
|
||||
// Informer returns the SharedIndexInformer.
|
||||
func (f *genericInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.informer
|
||||
}
|
||||
|
||||
// Lister returns the GenericLister.
|
||||
func (f *genericInformer) Lister() cache.GenericLister {
|
||||
return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource)
|
||||
}
|
||||
|
||||
// ForResource gives generic access to a shared informer of the matching type
|
||||
// TODO extend this to unknown resources with a client pool
|
||||
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
||||
switch resource {
|
||||
// Group=operator.karmada.io, Version=v1alpha1
|
||||
case v1alpha1.SchemeGroupVersion.WithResource("karmadas"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1alpha1().Karmadas().Informer()}, nil
|
||||
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("no informer found for %v", resource)
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package internalinterfaces
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
versioned "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
|
||||
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
|
||||
|
||||
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
|
||||
type SharedInformerFactory interface {
|
||||
Start(stopCh <-chan struct{})
|
||||
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
|
||||
}
|
||||
|
||||
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
|
||||
type TweakListOptionsFunc func(*v1.ListOptions)
|
|
@ -0,0 +1,30 @@
|
|||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package operator
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/karmada-io/karmada/operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/generated/informers/externalversions/operator/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)
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/karmada-io/karmada/operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// Karmadas returns a KarmadaInformer.
|
||||
Karmadas() KarmadaInformer
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
// Karmadas returns a KarmadaInformer.
|
||||
func (v *version) Karmadas() KarmadaInformer {
|
||||
return &karmadaInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
operatorv1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
versioned "github.com/karmada-io/karmada/operator/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/karmada-io/karmada/operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/generated/listers/operator/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"
|
||||
)
|
||||
|
||||
// KarmadaInformer provides access to a shared informer and lister for
|
||||
// Karmadas.
|
||||
type KarmadaInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.KarmadaLister
|
||||
}
|
||||
|
||||
type karmadaInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewKarmadaInformer constructs a new informer for Karmada 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 NewKarmadaInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredKarmadaInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredKarmadaInformer constructs a new informer for Karmada 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 NewFilteredKarmadaInformer(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.OperatorV1alpha1().Karmadas(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1alpha1().Karmadas(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&operatorv1alpha1.Karmada{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *karmadaInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredKarmadaInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *karmadaInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&operatorv1alpha1.Karmada{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *karmadaInformer) Lister() v1alpha1.KarmadaLister {
|
||||
return v1alpha1.NewKarmadaLister(f.Informer().GetIndexer())
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// KarmadaListerExpansion allows custom methods to be added to
|
||||
// KarmadaLister.
|
||||
type KarmadaListerExpansion interface{}
|
||||
|
||||
// KarmadaNamespaceListerExpansion allows custom methods to be added to
|
||||
// KarmadaNamespaceLister.
|
||||
type KarmadaNamespaceListerExpansion interface{}
|
|
@ -0,0 +1,83 @@
|
|||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "github.com/karmada-io/karmada/operator/pkg/apis/operator/v1alpha1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// KarmadaLister helps list Karmadas.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type KarmadaLister interface {
|
||||
// List lists all Karmadas in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1alpha1.Karmada, err error)
|
||||
// Karmadas returns an object that can list and get Karmadas.
|
||||
Karmadas(namespace string) KarmadaNamespaceLister
|
||||
KarmadaListerExpansion
|
||||
}
|
||||
|
||||
// karmadaLister implements the KarmadaLister interface.
|
||||
type karmadaLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewKarmadaLister returns a new KarmadaLister.
|
||||
func NewKarmadaLister(indexer cache.Indexer) KarmadaLister {
|
||||
return &karmadaLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Karmadas in the indexer.
|
||||
func (s *karmadaLister) List(selector labels.Selector) (ret []*v1alpha1.Karmada, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha1.Karmada))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Karmadas returns an object that can list and get Karmadas.
|
||||
func (s *karmadaLister) Karmadas(namespace string) KarmadaNamespaceLister {
|
||||
return karmadaNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// KarmadaNamespaceLister helps list and get Karmadas.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type KarmadaNamespaceLister interface {
|
||||
// List lists all Karmadas in the indexer for a given namespace.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1alpha1.Karmada, err error)
|
||||
// Get retrieves the Karmada from the indexer for a given namespace and name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1alpha1.Karmada, error)
|
||||
KarmadaNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// karmadaNamespaceLister implements the KarmadaNamespaceLister
|
||||
// interface.
|
||||
type karmadaNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all Karmadas in the indexer for a given namespace.
|
||||
func (s karmadaNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Karmada, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha1.Karmada))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Karmada from the indexer for a given namespace and name.
|
||||
func (s karmadaNamespaceLister) Get(name string) (*v1alpha1.Karmada, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1alpha1.Resource("karmada"), name)
|
||||
}
|
||||
return obj.(*v1alpha1.Karmada), nil
|
||||
}
|
Loading…
Reference in New Issue