diff --git a/Makefile b/Makefile index 2d6952fdb..eab4a393e 100644 --- a/Makefile +++ b/Makefile @@ -101,3 +101,14 @@ clean-test: include ./test/integration-test.mk include ./test/e2e/e2e-test.mk + +# Update vendor +.PHONY: vendor +vendor: + go mod tidy + go mod vendor + +# Copy CRDs +.PHONY: copy-crd +copy-crd: vendor + bash -x build/copy-crds.sh diff --git a/build/copy-crds.sh b/build/copy-crds.sh new file mode 100644 index 000000000..17e85fdf2 --- /dev/null +++ b/build/copy-crds.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright Contributors to the Open Cluster Management project + +KLUSTERLET_CRD_FILE="./vendor/open-cluster-management.io/api/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml" +CLUSTER_MANAGER_CRD_FILE="./vendor/open-cluster-management.io/api/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml" + +ALL_FILES=("./pkg/cmd/join/scenario/join/klusterlets.crd.yaml" + "./pkg/cmd/init/scenario/init/clustermanagers.crd.yaml" + ) + +cp "$KLUSTERLET_CRD_FILE" "${ALL_FILES[0]}" +cp "$CLUSTER_MANAGER_CRD_FILE" "${ALL_FILES[1]}" + +COMMUNITY_COPY_HEADER_FILE="$PWD/build/copyright-header.txt" + +if [ ! -f "$COMMUNITY_COPY_HEADER_FILE" ]; then + echo "File $COMMUNITY_COPY_HEADER_FILE not found!" + exit 1 +fi +COMMUNITY_COPY_HEADER_STRING=$(cat "$COMMUNITY_COPY_HEADER_FILE") + +for FILE in "${ALL_FILES[@]}" +do + if [ -f "$FILE" ] && ! grep -q "$COMMUNITY_COPY_HEADER_STRING" "$FILE"; then + echo "# $COMMUNITY_COPY_HEADER_STRING" > tempfile; + cat "$FILE" >> tempfile; + mv tempfile "$FILE"; + fi +done diff --git a/go.mod b/go.mod index ee89096e2..56639bccf 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( k8s.io/klog/v2 v2.60.1 k8s.io/kubectl v0.24.3 k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 - open-cluster-management.io/api v0.8.0 + open-cluster-management.io/api v0.9.1-0.20221116150238-55691c2c5f04 open-cluster-management.io/cluster-proxy v0.1.2 open-cluster-management.io/managed-serviceaccount v0.2.1-0.20220427065210-de6a7b7b5be8 sigs.k8s.io/apiserver-network-proxy v0.0.30 diff --git a/go.sum b/go.sum index 3b92b14d9..2b1a5304c 100644 --- a/go.sum +++ b/go.sum @@ -1672,8 +1672,8 @@ open-cluster-management.io/addon-framework v0.1.1-0.20211223101009-d6b1a7adae93/ open-cluster-management.io/addon-framework v0.2.1-0.20220317063747-100a0230a883/go.mod h1:8QG1fHwPCEdyRrzY2Jji+qhMmJl+/HzTpuSDVmeG+7s= open-cluster-management.io/api v0.5.0/go.mod h1:9qiA5h/8kvPQnJEOlAPHVjRO9a1jCmDhGzvgMBvXEaE= open-cluster-management.io/api v0.5.1-0.20220112073018-2d280a97a052/go.mod h1:0IUTh8J+p4pv1THh1r9oO0luX9Z1FLDEAmvzW09qC0o= -open-cluster-management.io/api v0.8.0 h1:hQLNyvvdx0G0iNxq80RWp93epNsUtsqJdLmGbXiYG5o= -open-cluster-management.io/api v0.8.0/go.mod h1:+OEARSAl2jIhuLItUcS30UgLA3khmA9ihygLVxzEn+U= +open-cluster-management.io/api v0.9.1-0.20221116150238-55691c2c5f04 h1:lXewKgs1MeWN1wPIlMGQxfQj83CgjkNXQKVJVYQEB5I= +open-cluster-management.io/api v0.9.1-0.20221116150238-55691c2c5f04/go.mod h1:9KkJPh/zpDevXj2P+zkvSVjC2pq2PQ1JDNLLEes8TEc= open-cluster-management.io/cluster-proxy v0.1.2 h1:0WYhPEZT6Wlt0dyE35GCC7zcqPo2poaALzdmVbQp9Dg= open-cluster-management.io/cluster-proxy v0.1.2/go.mod h1:f4HVfparQqOJsPrh4fTA4uyWx5KJ7MG2AcuSRypedws= open-cluster-management.io/managed-serviceaccount v0.2.1-0.20220427065210-de6a7b7b5be8 h1:foP5RkSec9DkUA8sJ5FLna5We8VxJyu0179id5zNXgA= diff --git a/pkg/cmd/create/sampleapp/exec_test.go b/pkg/cmd/create/sampleapp/exec_test.go index 2183c8d46..b28166c57 100644 --- a/pkg/cmd/create/sampleapp/exec_test.go +++ b/pkg/cmd/create/sampleapp/exec_test.go @@ -203,17 +203,17 @@ var _ = ginkgo.Describe("deploy samepleapp to every managed cluster", func() { subscriptionName = fmt.Sprintf("%s-subscription", o.SampleAppName) ) - if _, err = clusterClient.ClusterV1alpha1().Placements(testNamespace).Get(context.TODO(), placementResourceName, metav1.GetOptions{}); err != nil { + if _, err = clusterClient.ClusterV1beta1().Placements(testNamespace).Get(context.TODO(), placementResourceName, metav1.GetOptions{}); err != nil { return fmt.Errorf(fmt.Sprintf("Missing Placement resource \"%s\" in namespace %s", placementResourceName, testNamespace)) } fmt.Fprintf(streams.Out, "Placement resource \"%s\" created successfully in namespace %s.\n", placementResourceName, testNamespace) - if _, err = clusterClient.ClusterV1alpha1().ManagedClusterSets().Get(context.TODO(), managedClusterSetName, metav1.GetOptions{}); err != nil { + if _, err = clusterClient.ClusterV1beta2().ManagedClusterSets().Get(context.TODO(), managedClusterSetName, metav1.GetOptions{}); err != nil { return fmt.Errorf(fmt.Sprintf("Missing ManagedClusterSet resource \"%s\"", managedClusterSetName)) } fmt.Fprintf(streams.Out, "ManagedClusterSet resource \"%s\" created successfully.\n", managedClusterSetName) - if _, err = clusterClient.ClusterV1alpha1().ManagedClusterSetBindings(testNamespace).Get(context.TODO(), managedClusterSetBindingName, metav1.GetOptions{}); err != nil { + if _, err = clusterClient.ClusterV1beta2().ManagedClusterSetBindings(testNamespace).Get(context.TODO(), managedClusterSetBindingName, metav1.GetOptions{}); err != nil { return fmt.Errorf(fmt.Sprintf("Missing ManagedClusterSetBinding resource \"%s\" in namespace %s", managedClusterSetBindingName, testNamespace)) } fmt.Fprintf(streams.Out, "ManagedClusterSetBinding resource \"%s\" created successfully in namespace %s.\n", managedClusterSetBindingName, testNamespace) diff --git a/pkg/cmd/join/scenario/join/klusterlets.crd.yaml b/pkg/cmd/join/scenario/join/klusterlets.crd.yaml index a7686bc14..ae8bda1fb 100644 --- a/pkg/cmd/join/scenario/join/klusterlets.crd.yaml +++ b/pkg/cmd/join/scenario/join/klusterlets.crd.yaml @@ -132,6 +132,28 @@ spec: registrationImagePullSpec: description: RegistrationImagePullSpec represents the desired image configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified. type: string + workConfiguration: + description: WorkConfiguration contains the configuration of work + type: object + properties: + featureGates: + description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false." + type: array + items: + type: object + required: + - feature + properties: + feature: + description: Feature is the key of feature gate. e.g. featuregate/Foo. + type: string + mode: + description: Mode is either Enable, Disable, "" where "" is Disable by default. In Enable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=true". In Disable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=false". + type: string + default: Disable + enum: + - Enable + - Disable workImagePullSpec: description: WorkImagePullSpec represents the desired image configuration of work agent. quay.io/open-cluster-management.io/work:latest will be used if unspecified. type: string diff --git a/pkg/cmd/proxy/health/exec.go b/pkg/cmd/proxy/health/exec.go index b7ca58357..a10951bd4 100644 --- a/pkg/cmd/proxy/health/exec.go +++ b/pkg/cmd/proxy/health/exec.go @@ -6,7 +6,7 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "io/ioutil" + "io" "net" "net/http" "net/url" @@ -15,8 +15,6 @@ import ( "text/tabwriter" "time" - "k8s.io/apimachinery/pkg/util/sets" - "github.com/pkg/errors" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -25,6 +23,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8snet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -101,6 +100,9 @@ func (o *Options) run(streams genericclioptions.IOStreams) error { if err != nil { return errors.Wrapf(err, "failed initializing proxy api client") } + + // TODO: fix this deprecated field AddOnConfiguration + // nolint:staticcheck proxyConfig, err := proxyClient.ProxyV1alpha1().ManagedProxyConfigurations(). Get(context.TODO(), clusterAddon.Spec.AddOnConfiguration.CRName, metav1.GetOptions{}) if err != nil { @@ -275,7 +277,7 @@ func (o *Options) visit( } end := time.Now() - data, _ := ioutil.ReadAll(resp.Body) + data, _ := io.ReadAll(resp.Body) if "ok" == string(data) { health = "True" latency = end.Sub(start).String() diff --git a/pkg/cmd/proxy/kubectl/cmd.go b/pkg/cmd/proxy/kubectl/cmd.go index 875050149..5184ce98d 100644 --- a/pkg/cmd/proxy/kubectl/cmd.go +++ b/pkg/cmd/proxy/kubectl/cmd.go @@ -4,7 +4,6 @@ package kubectl import ( "context" "fmt" - "io/ioutil" "os" "os/exec" "strings" @@ -172,6 +171,9 @@ func getProxyConfig(hubRestConfig *rest.Config, streams genericclioptions.IOStre if err != nil { return nil, errors.Wrapf(err, "failed initializing proxy api client") } + + // TODO: fix this deprecated field AddOnConfiguration + // nolint:staticcheck proxyConfig, err := proxyClient.ProxyV1alpha1().ManagedProxyConfigurations(). Get(context.TODO(), clusterAddon.Spec.AddOnConfiguration.CRName, metav1.GetOptions{}) if err != nil { @@ -240,7 +242,7 @@ func genTmpKubeconfig(cluster string, msaToken string) (string, error) { } tmpFile := fmt.Sprintf("/tmp/%s-%s.kubeconfig", cluster, uuid.New().String()) - if err := ioutil.WriteFile(tmpFile, kubeconfigContent, 0644); err != nil { + if err := os.WriteFile(tmpFile, kubeconfigContent, 0644); err != nil { return "", err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 5cddb0a0c..3cd8df045 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -990,8 +990,8 @@ k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/trace -# open-cluster-management.io/api v0.8.0 -## explicit; go 1.18 +# open-cluster-management.io/api v0.9.1-0.20221116150238-55691c2c5f04 +## explicit; go 1.19 open-cluster-management.io/api/addon/v1alpha1 open-cluster-management.io/api/client/addon/clientset/versioned open-cluster-management.io/api/client/addon/clientset/versioned/scheme @@ -1001,17 +1001,21 @@ open-cluster-management.io/api/client/cluster/clientset/versioned/scheme open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1 open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1 open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1 +open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2 open-cluster-management.io/api/client/operator/clientset/versioned open-cluster-management.io/api/client/operator/clientset/versioned/scheme open-cluster-management.io/api/client/operator/clientset/versioned/typed/operator/v1 open-cluster-management.io/api/client/work/clientset/versioned open-cluster-management.io/api/client/work/clientset/versioned/scheme open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1 +open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1 open-cluster-management.io/api/cluster/v1 open-cluster-management.io/api/cluster/v1alpha1 open-cluster-management.io/api/cluster/v1beta1 +open-cluster-management.io/api/cluster/v1beta2 open-cluster-management.io/api/operator/v1 open-cluster-management.io/api/work/v1 +open-cluster-management.io/api/work/v1alpha1 # open-cluster-management.io/cluster-proxy v0.1.2 ## explicit; go 1.16 open-cluster-management.io/cluster-proxy/pkg/apis/proxy/v1alpha1 diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml index 6326a7b48..0367afb8e 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml @@ -38,7 +38,7 @@ spec: type: object properties: addOnConfiguration: - description: addOnConfiguration is a reference to configuration information for the add-on. In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration. + description: 'Deprecated: Use supportedConfigs filed instead addOnConfiguration is a reference to configuration information for the add-on. In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration.' type: object properties: crName: @@ -61,6 +61,40 @@ spec: displayName: description: displayName represents the name of add-on that will be displayed. type: string + supportedConfigs: + description: supportedConfigs is a list of configuration types supported by add-on. An empty list means the add-on does not require configurations. The default is an empty list + type: array + items: + description: ConfigMeta represents a collection of metadata information for add-on configuration. + type: object + required: + - resource + properties: + defaultConfig: + description: defaultConfig represents the namespace and name of the default add-on configuration. In scenario where all add-ons have a same configuration. + type: object + required: + - name + properties: + name: + description: name of the add-on configuration. + type: string + minLength: 1 + namespace: + description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. + type: string + group: + description: group of the add-on configuration. + type: string + default: "" + resource: + description: resource of the add-on configuration. + type: string + minLength: 1 + x-kubernetes-list-map-keys: + - group + - resource + x-kubernetes-list-type: map status: description: status represents the current status of cluster management add-on. type: object diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml index 614048d1e..d8842c6db 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml @@ -42,9 +42,34 @@ spec: description: spec holds configuration that could apply to any operator. type: object properties: + configs: + description: configs is a list of add-on configurations. In scenario where the current add-on has its own configurations. An empty list means there are no defautl configurations for add-on. The default is an empty list + type: array + items: + type: object + required: + - name + - resource + properties: + group: + description: group of the add-on configuration. + type: string + default: "" + name: + description: name of the add-on configuration. + type: string + minLength: 1 + namespace: + description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. + type: string + resource: + description: resource of the add-on configuration. + type: string + minLength: 1 installNamespace: description: installNamespace is the namespace on the managed cluster to install the addon agent. If it is not set, open-cluster-management-agent-addon namespace is used to install the addon agent. type: string + default: open-cluster-management-agent-addon maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ status: @@ -52,7 +77,7 @@ spec: type: object properties: addOnConfiguration: - description: addOnConfiguration is a reference to configuration information for the add-on. This resource is use to locate the configuration resource for the add-on. + description: 'Deprecated: Use configReference instead addOnConfiguration is a reference to configuration information for the add-on. This resource is use to locate the configuration resource for the add-on.' type: object properties: crName: @@ -119,6 +144,35 @@ spec: type: string maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + configReferences: + description: configReferences is a list of current add-on configuration references. This will be overridden by the clustermanagementaddon configuration references. + type: array + items: + description: ConfigReference is a reference to the current add-on configuration. This resource is used to locate the configuration resource for the current add-on. + type: object + required: + - name + - resource + properties: + group: + description: group of the add-on configuration. + type: string + default: "" + lastObservedGeneration: + description: lastObservedGeneration is the observed generation of the add-on configuration. + type: integer + format: int64 + name: + description: name of the add-on configuration. + type: string + minLength: 1 + namespace: + description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. + type: string + resource: + description: resource of the add-on configuration. + type: string + minLength: 1 healthCheck: description: healthCheck indicates how to check the healthiness status of the current addon. It should be set by each addon implementation, by default, the lease mode will be used. type: object diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml new file mode 100644 index 000000000..0707f403c --- /dev/null +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml @@ -0,0 +1,93 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: addondeploymentconfigs.addon.open-cluster-management.io +spec: + group: addon.open-cluster-management.io + names: + kind: AddOnDeploymentConfig + listKind: AddOnDeploymentConfigList + plural: addondeploymentconfigs + singular: addondeploymentconfig + scope: Namespaced + preserveUnknownFields: false + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: AddOnDeploymentConfig represents a deployment configuration for an add-on. + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: spec represents a desired configuration for an add-on. + type: object + properties: + customizedVariables: + description: CustomizedVariables is a list of name-value variables for the current add-on deployment. The add-on implementation can use these variables to render its add-on deployment. The default is an empty list. + type: array + items: + description: CustomizedVariable represents a customized variable for add-on deployment. + type: object + required: + - name + properties: + name: + description: Name of this variable. + type: string + maxLength: 255 + pattern: ^[a-zA-Z_][_a-zA-Z0-9]*$ + value: + description: Value of this variable. + type: string + maxLength: 1024 + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + nodePlacement: + description: NodePlacement enables explicit control over the scheduling of the add-on agents on the managed cluster. All add-on agent pods are expected to comply with this node placement. If the placement is nil, the placement is not specified, it will be omitted. If the placement is an empty object, the placement will match all nodes and tolerate nothing. + type: object + properties: + nodeSelector: + description: NodeSelector defines which Nodes the Pods are scheduled on. If the selector is an empty list, it will match all nodes. The default is an empty list. + type: object + additionalProperties: + type: string + tolerations: + description: Tolerations is attached by pods to tolerate any taint that matches the triple using the matching operator . If the tolerations is an empty list, it will tolerate nothing. The default is an empty list. + type: array + items: + description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + type: object + properties: + effect: + description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + type: integer + format: int64 + value: + description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/register.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/register.go index 6464d8be4..ac1f3383f 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/register.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/register.go @@ -34,6 +34,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterManagementAddOnList{}, &ManagedClusterAddOn{}, &ManagedClusterAddOnList{}, + &AddOnDeploymentConfig{}, + &AddOnDeploymentConfigList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) return nil diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_addondeploymentconfig.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_addondeploymentconfig.go new file mode 100644 index 000000000..e0ab38487 --- /dev/null +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_addondeploymentconfig.go @@ -0,0 +1,80 @@ +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 + +// AddOnDeploymentConfig represents a deployment configuration for an add-on. +type AddOnDeploymentConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec represents a desired configuration for an add-on. + // +required + Spec AddOnDeploymentConfigSpec `json:"spec"` +} + +type AddOnDeploymentConfigSpec struct { + // CustomizedVariables is a list of name-value variables for the current add-on deployment. + // The add-on implementation can use these variables to render its add-on deployment. + // The default is an empty list. + // +optional + // +listType=map + // +listMapKey=name + CustomizedVariables []CustomizedVariable `json:"customizedVariables,omitempty"` + + // NodePlacement enables explicit control over the scheduling of the add-on agents on the + // managed cluster. + // All add-on agent pods are expected to comply with this node placement. + // If the placement is nil, the placement is not specified, it will be omitted. + // If the placement is an empty object, the placement will match all nodes and tolerate nothing. + // +optional + NodePlacement *NodePlacement `json:"nodePlacement,omitempty"` +} + +// CustomizedVariable represents a customized variable for add-on deployment. +type CustomizedVariable struct { + // Name of this variable. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:MaxLength=255 + // +kubebuilder:validation:Pattern=^[a-zA-Z_][_a-zA-Z0-9]*$ + Name string `json:"name"` + + // Value of this variable. + // +kubebuilder:validation:MaxLength=1024 + Value string `json:"value"` +} + +// NodePlacement describes node scheduling configuration for the pods. +type NodePlacement struct { + // NodeSelector defines which Nodes the Pods are scheduled on. + // If the selector is an empty list, it will match all nodes. + // The default is an empty list. + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // Tolerations is attached by pods to tolerate any taint that matches + // the triple using the matching operator . + // If the tolerations is an empty list, it will tolerate nothing. + // The default is an empty list. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// AddOnDeploymentConfigList is a collection of add-on deployment config. +type AddOnDeploymentConfigList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + // Items is a list of add-on deployment config. + Items []AddOnDeploymentConfig `json:"items"` +} diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go index 17ae0b6ae..525748ac0 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go @@ -35,24 +35,45 @@ type ClusterManagementAddOn struct { type ClusterManagementAddOnSpec struct { // addOnMeta is a reference to the metadata information for the add-on. // +optional - AddOnMeta AddOnMeta `json:"addOnMeta"` + AddOnMeta AddOnMeta `json:"addOnMeta,omitempty"` + // Deprecated: Use supportedConfigs filed instead // addOnConfiguration is a reference to configuration information for the add-on. - // In scenario where a multiple add-ons share the same add-on CRD, - // multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration. + // In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn + // resources need to be created and reference the same AddOnConfiguration. // +optional - AddOnConfiguration ConfigCoordinates `json:"addOnConfiguration"` + AddOnConfiguration ConfigCoordinates `json:"addOnConfiguration,omitempty"` + + // supportedConfigs is a list of configuration types supported by add-on. + // An empty list means the add-on does not require configurations. + // The default is an empty list + // +optional + // +listType=map + // +listMapKey=group + // +listMapKey=resource + SupportedConfigs []ConfigMeta `json:"supportedConfigs,omitempty"` } // AddOnMeta represents a collection of metadata information for the add-on. type AddOnMeta struct { // displayName represents the name of add-on that will be displayed. // +optional - DisplayName string `json:"displayName"` + DisplayName string `json:"displayName,omitempty"` // description represents the detailed description of the add-on. // +optional - Description string `json:"description"` + Description string `json:"description,omitempty"` +} + +// ConfigMeta represents a collection of metadata information for add-on configuration. +type ConfigMeta struct { + // group and resouce of the add-on configuration. + ConfigGroupResource `json:",inline"` + + // defaultConfig represents the namespace and name of the default add-on configuration. + // In scenario where all add-ons have a same configuration. + // +optional + DefaultConfig *ConfigReferent `json:"defaultConfig,omitempty"` } // ConfigCoordinates represents the information for locating the CRD and CR that configures the add-on. @@ -60,18 +81,46 @@ type ConfigCoordinates struct { // crdName is the name of the CRD used to configure instances of the managed add-on. // This field should be configured if the add-on have a CRD that controls the configuration of the add-on. // +optional - CRDName string `json:"crdName"` + CRDName string `json:"crdName,omitempty"` // crName is the name of the CR used to configure instances of the managed add-on. // This field should be configured if add-on CR have a consistent name across the all of the ManagedCluster instaces. // +optional - CRName string `json:"crName"` + CRName string `json:"crName,omitempty"` // lastObservedGeneration is the observed generation of the custom resource for the configuration of the addon. // +optional LastObservedGeneration int64 `json:"lastObservedGeneration,omitempty"` } +// ConfigGroupResource represents the GroupResource of the add-on configuration +type ConfigGroupResource struct { + // group of the add-on configuration. + // +optional + // +kubebuilder:default="" + Group string `json:"group"` + + // resource of the add-on configuration. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength:=1 + Resource string `json:"resource"` +} + +// ConfigReferent represents the namespace and name for an add-on configuration. +type ConfigReferent struct { + // namespace of the add-on configuration. + // If this field is not set, the configuration is in the cluster scope. + // +optional + Namespace string `json:"namespace,omitempty"` + + // name of the add-on configuration. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength:=1 + Name string `json:"name"` +} + // ClusterManagementAddOnStatus represents the current status of cluster management add-on. type ClusterManagementAddOnStatus struct { } diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go index 7c20d159c..9fe2d16a0 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go @@ -35,9 +35,17 @@ type ManagedClusterAddOnSpec struct { // installNamespace is the namespace on the managed cluster to install the addon agent. // If it is not set, open-cluster-management-agent-addon namespace is used to install the addon agent. // +optional + // +kubebuilder:default=open-cluster-management-agent-addon // +kubebuilder:validation:MaxLength=63 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ InstallNamespace string `json:"installNamespace,omitempty"` + + // configs is a list of add-on configurations. + // In scenario where the current add-on has its own configurations. + // An empty list means there are no defautl configurations for add-on. + // The default is an empty list + // +optional + Configs []AddOnConfig `json:"configs,omitempty"` } // RegistrationConfig defines the configuration of the addon agent to register to hub. The Klusterlet agent will @@ -60,6 +68,14 @@ type RegistrationConfig struct { Subject Subject `json:"subject,omitempty"` } +type AddOnConfig struct { + // group and resource of add-on configuration. + ConfigGroupResource `json:",inline"` + + // name and namespace of add-on configuration. + ConfigReferent `json:",inline"` +} + // Subject is the user subject of the addon agent to be registered to the hub. type Subject struct { // user is the user name of the addon agent. @@ -94,12 +110,18 @@ type ManagedClusterAddOnStatus struct { // addOnMeta is a reference to the metadata information for the add-on. // This should be same as the addOnMeta for the corresponding ClusterManagementAddOn resource. // +optional - AddOnMeta AddOnMeta `json:"addOnMeta"` + AddOnMeta AddOnMeta `json:"addOnMeta,omitempty"` + // Deprecated: Use configReference instead // addOnConfiguration is a reference to configuration information for the add-on. // This resource is use to locate the configuration resource for the add-on. // +optional - AddOnConfiguration ConfigCoordinates `json:"addOnConfiguration"` + AddOnConfiguration ConfigCoordinates `json:"addOnConfiguration,omitempty"` + + // configReferences is a list of current add-on configuration references. + // This will be overridden by the clustermanagementaddon configuration references. + // +optional + ConfigReferences []ConfigReference `json:"configReferences,omitempty"` // registrations is the conifigurations for the addon agent to register to hub. It should be set by each addon controller // on hub to define how the addon agent on managedcluster is registered. With the registration defined, @@ -126,6 +148,9 @@ const ( // ManagedClusterAddOnConditionDegraded represents that the addon agent is providing degraded service on // the managed cluster. ManagedClusterAddOnConditionDegraded string = "Degraded" + + // ManagedClusterAddOnCondtionConfigured represents that the addon agent is configured with its configuration + ManagedClusterAddOnCondtionConfigured string = "Configured" ) // ObjectReference contains enough information to let you inspect or modify the referred object. @@ -147,6 +172,21 @@ type ObjectReference struct { Name string `json:"name"` } +// ConfigReference is a reference to the current add-on configuration. +// This resource is used to locate the configuration resource for the current add-on. +type ConfigReference struct { + // This field is synced from ClusterManagementAddOn configGroupResource field. + ConfigGroupResource `json:",inline"` + + // This field is synced from ClusterManagementAddOn defaultConfig and ManagedClusterAddOn config fields. + // If both of them are defined, the ManagedClusterAddOn configs will overwrite the ClusterManagementAddOn + // defaultConfigs. + ConfigReferent `json:",inline"` + + // lastObservedGeneration is the observed generation of the add-on configuration. + LastObservedGeneration int64 `json:"lastObservedGeneration"` +} + // HealthCheckMode indicates the mode for the addon to check its healthiness status // +kubebuilder:validation:Enum=Lease;Customized type HealthCheckMode string diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go index 0bd5ef90f..83b91d7b8 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go @@ -6,10 +6,115 @@ 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 *AddOnConfig) DeepCopyInto(out *AddOnConfig) { + *out = *in + out.ConfigGroupResource = in.ConfigGroupResource + out.ConfigReferent = in.ConfigReferent + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnConfig. +func (in *AddOnConfig) DeepCopy() *AddOnConfig { + if in == nil { + return nil + } + out := new(AddOnConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddOnDeploymentConfig) DeepCopyInto(out *AddOnDeploymentConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnDeploymentConfig. +func (in *AddOnDeploymentConfig) DeepCopy() *AddOnDeploymentConfig { + if in == nil { + return nil + } + out := new(AddOnDeploymentConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AddOnDeploymentConfig) 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 *AddOnDeploymentConfigList) DeepCopyInto(out *AddOnDeploymentConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AddOnDeploymentConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnDeploymentConfigList. +func (in *AddOnDeploymentConfigList) DeepCopy() *AddOnDeploymentConfigList { + if in == nil { + return nil + } + out := new(AddOnDeploymentConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AddOnDeploymentConfigList) 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 *AddOnDeploymentConfigSpec) DeepCopyInto(out *AddOnDeploymentConfigSpec) { + *out = *in + if in.CustomizedVariables != nil { + in, out := &in.CustomizedVariables, &out.CustomizedVariables + *out = make([]CustomizedVariable, len(*in)) + copy(*out, *in) + } + if in.NodePlacement != nil { + in, out := &in.NodePlacement, &out.NodePlacement + *out = new(NodePlacement) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnDeploymentConfigSpec. +func (in *AddOnDeploymentConfigSpec) DeepCopy() *AddOnDeploymentConfigSpec { + if in == nil { + return nil + } + out := new(AddOnDeploymentConfigSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AddOnMeta) DeepCopyInto(out *AddOnMeta) { *out = *in @@ -31,7 +136,7 @@ func (in *ClusterManagementAddOn) DeepCopyInto(out *ClusterManagementAddOn) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status return } @@ -92,6 +197,13 @@ func (in *ClusterManagementAddOnSpec) DeepCopyInto(out *ClusterManagementAddOnSp *out = *in out.AddOnMeta = in.AddOnMeta out.AddOnConfiguration = in.AddOnConfiguration + if in.SupportedConfigs != nil { + in, out := &in.SupportedConfigs, &out.SupportedConfigs + *out = make([]ConfigMeta, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -137,6 +249,94 @@ func (in *ConfigCoordinates) DeepCopy() *ConfigCoordinates { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigGroupResource) DeepCopyInto(out *ConfigGroupResource) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigGroupResource. +func (in *ConfigGroupResource) DeepCopy() *ConfigGroupResource { + if in == nil { + return nil + } + out := new(ConfigGroupResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMeta) DeepCopyInto(out *ConfigMeta) { + *out = *in + out.ConfigGroupResource = in.ConfigGroupResource + if in.DefaultConfig != nil { + in, out := &in.DefaultConfig, &out.DefaultConfig + *out = new(ConfigReferent) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMeta. +func (in *ConfigMeta) DeepCopy() *ConfigMeta { + if in == nil { + return nil + } + out := new(ConfigMeta) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigReference) DeepCopyInto(out *ConfigReference) { + *out = *in + out.ConfigGroupResource = in.ConfigGroupResource + out.ConfigReferent = in.ConfigReferent + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigReference. +func (in *ConfigReference) DeepCopy() *ConfigReference { + if in == nil { + return nil + } + out := new(ConfigReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigReferent) DeepCopyInto(out *ConfigReferent) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigReferent. +func (in *ConfigReferent) DeepCopy() *ConfigReferent { + if in == nil { + return nil + } + out := new(ConfigReferent) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomizedVariable) DeepCopyInto(out *CustomizedVariable) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomizedVariable. +func (in *CustomizedVariable) DeepCopy() *CustomizedVariable { + if in == nil { + return nil + } + out := new(CustomizedVariable) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { *out = *in @@ -158,7 +358,7 @@ func (in *ManagedClusterAddOn) DeepCopyInto(out *ManagedClusterAddOn) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return } @@ -217,6 +417,11 @@ func (in *ManagedClusterAddOnList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterAddOnSpec) DeepCopyInto(out *ManagedClusterAddOnSpec) { *out = *in + if in.Configs != nil { + in, out := &in.Configs, &out.Configs + *out = make([]AddOnConfig, len(*in)) + copy(*out, *in) + } return } @@ -247,6 +452,11 @@ func (in *ManagedClusterAddOnStatus) DeepCopyInto(out *ManagedClusterAddOnStatus } out.AddOnMeta = in.AddOnMeta out.AddOnConfiguration = in.AddOnConfiguration + if in.ConfigReferences != nil { + in, out := &in.ConfigReferences, &out.ConfigReferences + *out = make([]ConfigReference, len(*in)) + copy(*out, *in) + } if in.Registrations != nil { in, out := &in.Registrations, &out.Registrations *out = make([]RegistrationConfig, len(*in)) @@ -268,6 +478,36 @@ func (in *ManagedClusterAddOnStatus) DeepCopy() *ManagedClusterAddOnStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePlacement) DeepCopyInto(out *NodePlacement) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]corev1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePlacement. +func (in *NodePlacement) DeepCopy() *NodePlacement { + if in == nil { + return nil + } + out := new(NodePlacement) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ObjectReference) DeepCopyInto(out *ObjectReference) { *out = *in diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go index b8dbd2192..2278ea4b3 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go @@ -11,6 +11,54 @@ package v1alpha1 // Those methods can be generated by using hack/update-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE +var map_AddOnDeploymentConfig = map[string]string{ + "": "AddOnDeploymentConfig represents a deployment configuration for an add-on.", + "spec": "spec represents a desired configuration for an add-on.", +} + +func (AddOnDeploymentConfig) SwaggerDoc() map[string]string { + return map_AddOnDeploymentConfig +} + +var map_AddOnDeploymentConfigList = map[string]string{ + "": "AddOnDeploymentConfigList is a collection of add-on deployment config.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + "items": "Items is a list of add-on deployment config.", +} + +func (AddOnDeploymentConfigList) SwaggerDoc() map[string]string { + return map_AddOnDeploymentConfigList +} + +var map_AddOnDeploymentConfigSpec = map[string]string{ + "customizedVariables": "CustomizedVariables is a list of name-value variables for the current add-on deployment. The add-on implementation can use these variables to render its add-on deployment. The default is an empty list.", + "nodePlacement": "NodePlacement enables explicit control over the scheduling of the add-on agents on the managed cluster. All add-on agent pods are expected to comply with this node placement. If the placement is nil, the placement is not specified, it will be omitted. If the placement is an empty object, the placement will match all nodes and tolerate nothing.", +} + +func (AddOnDeploymentConfigSpec) SwaggerDoc() map[string]string { + return map_AddOnDeploymentConfigSpec +} + +var map_CustomizedVariable = map[string]string{ + "": "CustomizedVariable represents a customized variable for add-on deployment.", + "name": "Name of this variable.", + "value": "Value of this variable.", +} + +func (CustomizedVariable) SwaggerDoc() map[string]string { + return map_CustomizedVariable +} + +var map_NodePlacement = map[string]string{ + "": "NodePlacement describes node scheduling configuration for the pods.", + "nodeSelector": "NodeSelector defines which Nodes the Pods are scheduled on. If the selector is an empty list, it will match all nodes. The default is an empty list.", + "tolerations": "Tolerations is attached by pods to tolerate any taint that matches the triple using the matching operator . If the tolerations is an empty list, it will tolerate nothing. The default is an empty list.", +} + +func (NodePlacement) SwaggerDoc() map[string]string { + return map_NodePlacement +} + var map_AddOnMeta = map[string]string{ "": "AddOnMeta represents a collection of metadata information for the add-on.", "displayName": "displayName represents the name of add-on that will be displayed.", @@ -44,7 +92,8 @@ func (ClusterManagementAddOnList) SwaggerDoc() map[string]string { var map_ClusterManagementAddOnSpec = map[string]string{ "": "ClusterManagementAddOnSpec provides information for the add-on.", "addOnMeta": "addOnMeta is a reference to the metadata information for the add-on.", - "addOnConfiguration": "addOnConfiguration is a reference to configuration information for the add-on. In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration.", + "addOnConfiguration": "Deprecated: Use supportedConfigs filed instead addOnConfiguration is a reference to configuration information for the add-on. In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration.", + "supportedConfigs": "supportedConfigs is a list of configuration types supported by add-on. An empty list means the add-on does not require configurations. The default is an empty list", } func (ClusterManagementAddOnSpec) SwaggerDoc() map[string]string { @@ -70,6 +119,44 @@ func (ConfigCoordinates) SwaggerDoc() map[string]string { return map_ConfigCoordinates } +var map_ConfigGroupResource = map[string]string{ + "": "ConfigGroupResource represents the GroupResource of the add-on configuration", + "group": "group of the add-on configuration.", + "resource": "resource of the add-on configuration.", +} + +func (ConfigGroupResource) SwaggerDoc() map[string]string { + return map_ConfigGroupResource +} + +var map_ConfigMeta = map[string]string{ + "": "ConfigMeta represents a collection of metadata information for add-on configuration.", + "defaultConfig": "defaultConfig represents the namespace and name of the default add-on configuration. In scenario where all add-ons have a same configuration.", +} + +func (ConfigMeta) SwaggerDoc() map[string]string { + return map_ConfigMeta +} + +var map_ConfigReferent = map[string]string{ + "": "ConfigReferent represents the namespace and name for an add-on configuration.", + "namespace": "namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.", + "name": "name of the add-on configuration.", +} + +func (ConfigReferent) SwaggerDoc() map[string]string { + return map_ConfigReferent +} + +var map_ConfigReference = map[string]string{ + "": "ConfigReference is a reference to the current add-on configuration. This resource is used to locate the configuration resource for the current add-on.", + "lastObservedGeneration": "lastObservedGeneration is the observed generation of the add-on configuration.", +} + +func (ConfigReference) SwaggerDoc() map[string]string { + return map_ConfigReference +} + var map_HealthCheck = map[string]string{ "mode": "mode indicates which mode will be used to check the healthiness status of the addon.", } @@ -99,6 +186,7 @@ func (ManagedClusterAddOnList) SwaggerDoc() map[string]string { var map_ManagedClusterAddOnSpec = map[string]string{ "": "ManagedClusterAddOnSpec defines the install configuration of an addon agent on managed cluster.", "installNamespace": "installNamespace is the namespace on the managed cluster to install the addon agent. If it is not set, open-cluster-management-agent-addon namespace is used to install the addon agent.", + "configs": "configs is a list of add-on configurations. In scenario where the current add-on has its own configurations. An empty list means there are no defautl configurations for add-on. The default is an empty list", } func (ManagedClusterAddOnSpec) SwaggerDoc() map[string]string { @@ -110,7 +198,8 @@ var map_ManagedClusterAddOnStatus = map[string]string{ "conditions": "conditions describe the state of the managed and monitored components for the operator.", "relatedObjects": "relatedObjects is a list of objects that are \"interesting\" or related to this operator. Common uses are: 1. the detailed resource driving the operator 2. operator namespaces 3. operand namespaces 4. related ClusterManagementAddon resource", "addOnMeta": "addOnMeta is a reference to the metadata information for the add-on. This should be same as the addOnMeta for the corresponding ClusterManagementAddOn resource.", - "addOnConfiguration": "addOnConfiguration is a reference to configuration information for the add-on. This resource is use to locate the configuration resource for the add-on.", + "addOnConfiguration": "Deprecated: Use configReference instead addOnConfiguration is a reference to configuration information for the add-on. This resource is use to locate the configuration resource for the add-on.", + "configReferences": "configReferences is a list of current add-on configuration references. This will be overridden by the clustermanagementaddon configuration references.", "registrations": "registrations is the conifigurations for the addon agent to register to hub. It should be set by each addon controller on hub to define how the addon agent on managedcluster is registered. With the registration defined, The addon agent can access to kube apiserver with kube style API or other endpoints on hub cluster with client certificate authentication. A csr will be created per registration configuration. If more than one registrationConfig is defined, a csr will be created for each registration configuration. It is not allowed that multiple registrationConfigs have the same signer name. After the csr is approved on the hub cluster, the klusterlet agent will create a secret in the installNamespace for the registrationConfig. If the signerName is \"kubernetes.io/kube-apiserver-client\", the secret name will be \"{addon name}-hub-kubeconfig\" whose contents includes key/cert and kubeconfig. Otherwise, the secret name will be \"{addon name}-{signer name}-client-cert\" whose contents includes key/cert.", "healthCheck": "healthCheck indicates how to check the healthiness status of the current addon. It should be set by each addon implementation, by default, the lease mode will be used.", } diff --git a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/scheme/register.go b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/scheme/register.go index 3807d8631..9dd616b51 100644 --- a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/scheme/register.go +++ b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/scheme/register.go @@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // 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" -// ) +// 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) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addon_client.go b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addon_client.go index 895e7a4eb..175a2f4a2 100644 --- a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addon_client.go +++ b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addon_client.go @@ -12,6 +12,7 @@ import ( type AddonV1alpha1Interface interface { RESTClient() rest.Interface + AddOnDeploymentConfigsGetter ClusterManagementAddOnsGetter ManagedClusterAddOnsGetter } @@ -21,6 +22,10 @@ type AddonV1alpha1Client struct { restClient rest.Interface } +func (c *AddonV1alpha1Client) AddOnDeploymentConfigs(namespace string) AddOnDeploymentConfigInterface { + return newAddOnDeploymentConfigs(c, namespace) +} + func (c *AddonV1alpha1Client) ClusterManagementAddOns() ClusterManagementAddOnInterface { return newClusterManagementAddOns(c) } diff --git a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addondeploymentconfig.go b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addondeploymentconfig.go new file mode 100644 index 000000000..e6888f16b --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/addondeploymentconfig.go @@ -0,0 +1,162 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + 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" + v1alpha1 "open-cluster-management.io/api/addon/v1alpha1" + scheme "open-cluster-management.io/api/client/addon/clientset/versioned/scheme" +) + +// AddOnDeploymentConfigsGetter has a method to return a AddOnDeploymentConfigInterface. +// A group's client should implement this interface. +type AddOnDeploymentConfigsGetter interface { + AddOnDeploymentConfigs(namespace string) AddOnDeploymentConfigInterface +} + +// AddOnDeploymentConfigInterface has methods to work with AddOnDeploymentConfig resources. +type AddOnDeploymentConfigInterface interface { + Create(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.CreateOptions) (*v1alpha1.AddOnDeploymentConfig, error) + Update(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.UpdateOptions) (*v1alpha1.AddOnDeploymentConfig, 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.AddOnDeploymentConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AddOnDeploymentConfigList, 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.AddOnDeploymentConfig, err error) + AddOnDeploymentConfigExpansion +} + +// addOnDeploymentConfigs implements AddOnDeploymentConfigInterface +type addOnDeploymentConfigs struct { + client rest.Interface + ns string +} + +// newAddOnDeploymentConfigs returns a AddOnDeploymentConfigs +func newAddOnDeploymentConfigs(c *AddonV1alpha1Client, namespace string) *addOnDeploymentConfigs { + return &addOnDeploymentConfigs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the addOnDeploymentConfig, and returns the corresponding addOnDeploymentConfig object, and an error if there is any. +func (c *addOnDeploymentConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) { + result = &v1alpha1.AddOnDeploymentConfig{} + err = c.client.Get(). + Namespace(c.ns). + Resource("addondeploymentconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AddOnDeploymentConfigs that match those selectors. +func (c *addOnDeploymentConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnDeploymentConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.AddOnDeploymentConfigList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("addondeploymentconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested addOnDeploymentConfigs. +func (c *addOnDeploymentConfigs) 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("addondeploymentconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a addOnDeploymentConfig and creates it. Returns the server's representation of the addOnDeploymentConfig, and an error, if there is any. +func (c *addOnDeploymentConfigs) Create(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.CreateOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) { + result = &v1alpha1.AddOnDeploymentConfig{} + err = c.client.Post(). + Namespace(c.ns). + Resource("addondeploymentconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(addOnDeploymentConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a addOnDeploymentConfig and updates it. Returns the server's representation of the addOnDeploymentConfig, and an error, if there is any. +func (c *addOnDeploymentConfigs) Update(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.UpdateOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) { + result = &v1alpha1.AddOnDeploymentConfig{} + err = c.client.Put(). + Namespace(c.ns). + Resource("addondeploymentconfigs"). + Name(addOnDeploymentConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(addOnDeploymentConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the addOnDeploymentConfig and deletes it. Returns an error if one occurs. +func (c *addOnDeploymentConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("addondeploymentconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *addOnDeploymentConfigs) 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("addondeploymentconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched addOnDeploymentConfig. +func (c *addOnDeploymentConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnDeploymentConfig, err error) { + result = &v1alpha1.AddOnDeploymentConfig{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("addondeploymentconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/generated_expansion.go b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/generated_expansion.go index 06fa938e4..c3d0b0d49 100644 --- a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/generated_expansion.go +++ b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1/generated_expansion.go @@ -2,6 +2,8 @@ package v1alpha1 +type AddOnDeploymentConfigExpansion interface{} + type ClusterManagementAddOnExpansion interface{} type ManagedClusterAddOnExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go index 9e52a0b92..dfc37ff6f 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go @@ -12,6 +12,7 @@ import ( clusterv1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1" clusterv1alpha1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1" clusterv1beta1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1" + clusterv1beta2 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2" ) type Interface interface { @@ -19,6 +20,7 @@ type Interface interface { ClusterV1() clusterv1.ClusterV1Interface ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface ClusterV1beta1() clusterv1beta1.ClusterV1beta1Interface + ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface } // Clientset contains the clients for groups. Each group has exactly one @@ -28,6 +30,7 @@ type Clientset struct { clusterV1 *clusterv1.ClusterV1Client clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client clusterV1beta1 *clusterv1beta1.ClusterV1beta1Client + clusterV1beta2 *clusterv1beta2.ClusterV1beta2Client } // ClusterV1 retrieves the ClusterV1Client @@ -45,6 +48,11 @@ func (c *Clientset) ClusterV1beta1() clusterv1beta1.ClusterV1beta1Interface { return c.clusterV1beta1 } +// ClusterV1beta2 retrieves the ClusterV1beta2Client +func (c *Clientset) ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface { + return c.clusterV1beta2 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -97,6 +105,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.clusterV1beta2, err = clusterv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -121,6 +133,7 @@ func New(c rest.Interface) *Clientset { cs.clusterV1 = clusterv1.New(c) cs.clusterV1alpha1 = clusterv1alpha1.New(c) cs.clusterV1beta1 = clusterv1beta1.New(c) + cs.clusterV1beta2 = clusterv1beta2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/register.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/register.go index f8360b0e1..57c11727f 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/register.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/register.go @@ -11,6 +11,7 @@ import ( clusterv1 "open-cluster-management.io/api/cluster/v1" clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1" + clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2" ) var Scheme = runtime.NewScheme() @@ -20,19 +21,20 @@ var localSchemeBuilder = runtime.SchemeBuilder{ clusterv1.AddToScheme, clusterv1alpha1.AddToScheme, clusterv1beta1.AddToScheme, + clusterv1beta2.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" -// ) +// 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) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go index 32c960a61..e072aa81f 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go @@ -14,10 +14,6 @@ type ClusterV1alpha1Interface interface { RESTClient() rest.Interface AddOnPlacementScoresGetter ClusterClaimsGetter - ManagedClusterSetsGetter - ManagedClusterSetBindingsGetter - PlacementsGetter - PlacementDecisionsGetter } // ClusterV1alpha1Client is used to interact with features provided by the cluster.open-cluster-management.io group. @@ -33,22 +29,6 @@ func (c *ClusterV1alpha1Client) ClusterClaims() ClusterClaimInterface { return newClusterClaims(c) } -func (c *ClusterV1alpha1Client) ManagedClusterSets() ManagedClusterSetInterface { - return newManagedClusterSets(c) -} - -func (c *ClusterV1alpha1Client) ManagedClusterSetBindings(namespace string) ManagedClusterSetBindingInterface { - return newManagedClusterSetBindings(c, namespace) -} - -func (c *ClusterV1alpha1Client) Placements(namespace string) PlacementInterface { - return newPlacements(c, namespace) -} - -func (c *ClusterV1alpha1Client) PlacementDecisions(namespace string) PlacementDecisionInterface { - return newPlacementDecisions(c, namespace) -} - // NewForConfig creates a new ClusterV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go index 991d91b1c..e1db73fc9 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go @@ -5,11 +5,3 @@ package v1alpha1 type AddOnPlacementScoreExpansion interface{} type ClusterClaimExpansion interface{} - -type ManagedClusterSetExpansion interface{} - -type ManagedClusterSetBindingExpansion interface{} - -type PlacementExpansion interface{} - -type PlacementDecisionExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/placement.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/placement.go deleted file mode 100644 index 46f1f7e37..000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/placement.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - 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" - scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" - v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" -) - -// PlacementsGetter has a method to return a PlacementInterface. -// A group's client should implement this interface. -type PlacementsGetter interface { - Placements(namespace string) PlacementInterface -} - -// PlacementInterface has methods to work with Placement resources. -type PlacementInterface interface { - Create(ctx context.Context, placement *v1alpha1.Placement, opts v1.CreateOptions) (*v1alpha1.Placement, error) - Update(ctx context.Context, placement *v1alpha1.Placement, opts v1.UpdateOptions) (*v1alpha1.Placement, error) - UpdateStatus(ctx context.Context, placement *v1alpha1.Placement, opts v1.UpdateOptions) (*v1alpha1.Placement, 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.Placement, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PlacementList, 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.Placement, err error) - PlacementExpansion -} - -// placements implements PlacementInterface -type placements struct { - client rest.Interface - ns string -} - -// newPlacements returns a Placements -func newPlacements(c *ClusterV1alpha1Client, namespace string) *placements { - return &placements{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the placement, and returns the corresponding placement object, and an error if there is any. -func (c *placements) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Placement, err error) { - result = &v1alpha1.Placement{} - err = c.client.Get(). - Namespace(c.ns). - Resource("placements"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Placements that match those selectors. -func (c *placements) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PlacementList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PlacementList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("placements"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested placements. -func (c *placements) 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("placements"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a placement and creates it. Returns the server's representation of the placement, and an error, if there is any. -func (c *placements) Create(ctx context.Context, placement *v1alpha1.Placement, opts v1.CreateOptions) (result *v1alpha1.Placement, err error) { - result = &v1alpha1.Placement{} - err = c.client.Post(). - Namespace(c.ns). - Resource("placements"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(placement). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a placement and updates it. Returns the server's representation of the placement, and an error, if there is any. -func (c *placements) Update(ctx context.Context, placement *v1alpha1.Placement, opts v1.UpdateOptions) (result *v1alpha1.Placement, err error) { - result = &v1alpha1.Placement{} - err = c.client.Put(). - Namespace(c.ns). - Resource("placements"). - Name(placement.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(placement). - 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 *placements) UpdateStatus(ctx context.Context, placement *v1alpha1.Placement, opts v1.UpdateOptions) (result *v1alpha1.Placement, err error) { - result = &v1alpha1.Placement{} - err = c.client.Put(). - Namespace(c.ns). - Resource("placements"). - Name(placement.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(placement). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the placement and deletes it. Returns an error if one occurs. -func (c *placements) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("placements"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *placements) 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("placements"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched placement. -func (c *placements) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Placement, err error) { - result = &v1alpha1.Placement{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("placements"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/placementdecision.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/placementdecision.go deleted file mode 100644 index 72c96a26e..000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/placementdecision.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - 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" - scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" - v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" -) - -// PlacementDecisionsGetter has a method to return a PlacementDecisionInterface. -// A group's client should implement this interface. -type PlacementDecisionsGetter interface { - PlacementDecisions(namespace string) PlacementDecisionInterface -} - -// PlacementDecisionInterface has methods to work with PlacementDecision resources. -type PlacementDecisionInterface interface { - Create(ctx context.Context, placementDecision *v1alpha1.PlacementDecision, opts v1.CreateOptions) (*v1alpha1.PlacementDecision, error) - Update(ctx context.Context, placementDecision *v1alpha1.PlacementDecision, opts v1.UpdateOptions) (*v1alpha1.PlacementDecision, error) - UpdateStatus(ctx context.Context, placementDecision *v1alpha1.PlacementDecision, opts v1.UpdateOptions) (*v1alpha1.PlacementDecision, 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.PlacementDecision, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PlacementDecisionList, 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.PlacementDecision, err error) - PlacementDecisionExpansion -} - -// placementDecisions implements PlacementDecisionInterface -type placementDecisions struct { - client rest.Interface - ns string -} - -// newPlacementDecisions returns a PlacementDecisions -func newPlacementDecisions(c *ClusterV1alpha1Client, namespace string) *placementDecisions { - return &placementDecisions{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the placementDecision, and returns the corresponding placementDecision object, and an error if there is any. -func (c *placementDecisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PlacementDecision, err error) { - result = &v1alpha1.PlacementDecision{} - err = c.client.Get(). - Namespace(c.ns). - Resource("placementdecisions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PlacementDecisions that match those selectors. -func (c *placementDecisions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PlacementDecisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PlacementDecisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("placementdecisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested placementDecisions. -func (c *placementDecisions) 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("placementdecisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a placementDecision and creates it. Returns the server's representation of the placementDecision, and an error, if there is any. -func (c *placementDecisions) Create(ctx context.Context, placementDecision *v1alpha1.PlacementDecision, opts v1.CreateOptions) (result *v1alpha1.PlacementDecision, err error) { - result = &v1alpha1.PlacementDecision{} - err = c.client.Post(). - Namespace(c.ns). - Resource("placementdecisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(placementDecision). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a placementDecision and updates it. Returns the server's representation of the placementDecision, and an error, if there is any. -func (c *placementDecisions) Update(ctx context.Context, placementDecision *v1alpha1.PlacementDecision, opts v1.UpdateOptions) (result *v1alpha1.PlacementDecision, err error) { - result = &v1alpha1.PlacementDecision{} - err = c.client.Put(). - Namespace(c.ns). - Resource("placementdecisions"). - Name(placementDecision.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(placementDecision). - 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 *placementDecisions) UpdateStatus(ctx context.Context, placementDecision *v1alpha1.PlacementDecision, opts v1.UpdateOptions) (result *v1alpha1.PlacementDecision, err error) { - result = &v1alpha1.PlacementDecision{} - err = c.client.Put(). - Namespace(c.ns). - Resource("placementdecisions"). - Name(placementDecision.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(placementDecision). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the placementDecision and deletes it. Returns an error if one occurs. -func (c *placementDecisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("placementdecisions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *placementDecisions) 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("placementdecisions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched placementDecision. -func (c *placementDecisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PlacementDecision, err error) { - result = &v1alpha1.PlacementDecision{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("placementdecisions"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/cluster_client.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/cluster_client.go new file mode 100644 index 000000000..e68271b68 --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/cluster_client.go @@ -0,0 +1,96 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" + v1beta2 "open-cluster-management.io/api/cluster/v1beta2" +) + +type ClusterV1beta2Interface interface { + RESTClient() rest.Interface + ManagedClusterSetsGetter + ManagedClusterSetBindingsGetter +} + +// ClusterV1beta2Client is used to interact with features provided by the cluster.open-cluster-management.io group. +type ClusterV1beta2Client struct { + restClient rest.Interface +} + +func (c *ClusterV1beta2Client) ManagedClusterSets() ManagedClusterSetInterface { + return newManagedClusterSets(c) +} + +func (c *ClusterV1beta2Client) ManagedClusterSetBindings(namespace string) ManagedClusterSetBindingInterface { + return newManagedClusterSetBindings(c, namespace) +} + +// NewForConfig creates a new ClusterV1beta2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ClusterV1beta2Client, 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 ClusterV1beta2Client 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) (*ClusterV1beta2Client, 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 &ClusterV1beta2Client{client}, nil +} + +// NewForConfigOrDie creates a new ClusterV1beta2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ClusterV1beta2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ClusterV1beta2Client for the given RESTClient. +func New(c rest.Interface) *ClusterV1beta2Client { + return &ClusterV1beta2Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta2.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 *ClusterV1beta2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/doc.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/doc.go new file mode 100644 index 000000000..ebe38377f --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta2 diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/generated_expansion.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/generated_expansion.go new file mode 100644 index 000000000..c651d50b1 --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/generated_expansion.go @@ -0,0 +1,7 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +type ManagedClusterSetExpansion interface{} + +type ManagedClusterSetBindingExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/managedclusterset.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclusterset.go similarity index 76% rename from vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/managedclusterset.go rename to vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclusterset.go index a284783f7..5ca1be32a 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/managedclusterset.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclusterset.go @@ -1,6 +1,6 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta2 import ( "context" @@ -11,7 +11,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" - v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" + v1beta2 "open-cluster-management.io/api/cluster/v1beta2" ) // ManagedClusterSetsGetter has a method to return a ManagedClusterSetInterface. @@ -22,15 +22,15 @@ type ManagedClusterSetsGetter interface { // ManagedClusterSetInterface has methods to work with ManagedClusterSet resources. type ManagedClusterSetInterface interface { - Create(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.CreateOptions) (*v1alpha1.ManagedClusterSet, error) - Update(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterSet, error) - UpdateStatus(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterSet, error) + Create(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.CreateOptions) (*v1beta2.ManagedClusterSet, error) + Update(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSet, error) + UpdateStatus(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSet, 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.ManagedClusterSet, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ManagedClusterSetList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ManagedClusterSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ManagedClusterSetList, 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.ManagedClusterSet, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSet, err error) ManagedClusterSetExpansion } @@ -40,15 +40,15 @@ type managedClusterSets struct { } // newManagedClusterSets returns a ManagedClusterSets -func newManagedClusterSets(c *ClusterV1alpha1Client) *managedClusterSets { +func newManagedClusterSets(c *ClusterV1beta2Client) *managedClusterSets { return &managedClusterSets{ client: c.RESTClient(), } } // Get takes name of the managedClusterSet, and returns the corresponding managedClusterSet object, and an error if there is any. -func (c *managedClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManagedClusterSet, err error) { - result = &v1alpha1.ManagedClusterSet{} +func (c *managedClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSet, err error) { + result = &v1beta2.ManagedClusterSet{} err = c.client.Get(). Resource("managedclustersets"). Name(name). @@ -59,12 +59,12 @@ func (c *managedClusterSets) Get(ctx context.Context, name string, options v1.Ge } // List takes label and field selectors, and returns the list of ManagedClusterSets that match those selectors. -func (c *managedClusterSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ManagedClusterSetList, err error) { +func (c *managedClusterSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ManagedClusterSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.ManagedClusterSetList{} + result = &v1beta2.ManagedClusterSetList{} err = c.client.Get(). Resource("managedclustersets"). VersionedParams(&opts, scheme.ParameterCodec). @@ -89,8 +89,8 @@ func (c *managedClusterSets) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a managedClusterSet and creates it. Returns the server's representation of the managedClusterSet, and an error, if there is any. -func (c *managedClusterSets) Create(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.CreateOptions) (result *v1alpha1.ManagedClusterSet, err error) { - result = &v1alpha1.ManagedClusterSet{} +func (c *managedClusterSets) Create(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSet, err error) { + result = &v1beta2.ManagedClusterSet{} err = c.client.Post(). Resource("managedclustersets"). VersionedParams(&opts, scheme.ParameterCodec). @@ -101,8 +101,8 @@ func (c *managedClusterSets) Create(ctx context.Context, managedClusterSet *v1al } // Update takes the representation of a managedClusterSet and updates it. Returns the server's representation of the managedClusterSet, and an error, if there is any. -func (c *managedClusterSets) Update(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterSet, err error) { - result = &v1alpha1.ManagedClusterSet{} +func (c *managedClusterSets) Update(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSet, err error) { + result = &v1beta2.ManagedClusterSet{} err = c.client.Put(). Resource("managedclustersets"). Name(managedClusterSet.Name). @@ -115,8 +115,8 @@ func (c *managedClusterSets) Update(ctx context.Context, managedClusterSet *v1al // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *managedClusterSets) UpdateStatus(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterSet, err error) { - result = &v1alpha1.ManagedClusterSet{} +func (c *managedClusterSets) UpdateStatus(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSet, err error) { + result = &v1beta2.ManagedClusterSet{} err = c.client.Put(). Resource("managedclustersets"). Name(managedClusterSet.Name). @@ -154,8 +154,8 @@ func (c *managedClusterSets) DeleteCollection(ctx context.Context, opts v1.Delet } // Patch applies the patch and returns the patched managedClusterSet. -func (c *managedClusterSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterSet, err error) { - result = &v1alpha1.ManagedClusterSet{} +func (c *managedClusterSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSet, err error) { + result = &v1beta2.ManagedClusterSet{} err = c.client.Patch(pt). Resource("managedclustersets"). Name(name). diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/managedclustersetbinding.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclustersetbinding.go similarity index 68% rename from vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/managedclustersetbinding.go rename to vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclustersetbinding.go index 102c9299c..eb24f1250 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/managedclustersetbinding.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclustersetbinding.go @@ -1,6 +1,6 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta2 import ( "context" @@ -11,7 +11,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" - v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" + v1beta2 "open-cluster-management.io/api/cluster/v1beta2" ) // ManagedClusterSetBindingsGetter has a method to return a ManagedClusterSetBindingInterface. @@ -22,14 +22,15 @@ type ManagedClusterSetBindingsGetter interface { // ManagedClusterSetBindingInterface has methods to work with ManagedClusterSetBinding resources. type ManagedClusterSetBindingInterface interface { - Create(ctx context.Context, managedClusterSetBinding *v1alpha1.ManagedClusterSetBinding, opts v1.CreateOptions) (*v1alpha1.ManagedClusterSetBinding, error) - Update(ctx context.Context, managedClusterSetBinding *v1alpha1.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterSetBinding, error) + Create(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (*v1beta2.ManagedClusterSetBinding, error) + Update(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSetBinding, error) + UpdateStatus(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSetBinding, 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.ManagedClusterSetBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ManagedClusterSetBindingList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ManagedClusterSetBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ManagedClusterSetBindingList, 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.ManagedClusterSetBinding, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSetBinding, err error) ManagedClusterSetBindingExpansion } @@ -40,7 +41,7 @@ type managedClusterSetBindings struct { } // newManagedClusterSetBindings returns a ManagedClusterSetBindings -func newManagedClusterSetBindings(c *ClusterV1alpha1Client, namespace string) *managedClusterSetBindings { +func newManagedClusterSetBindings(c *ClusterV1beta2Client, namespace string) *managedClusterSetBindings { return &managedClusterSetBindings{ client: c.RESTClient(), ns: namespace, @@ -48,8 +49,8 @@ func newManagedClusterSetBindings(c *ClusterV1alpha1Client, namespace string) *m } // Get takes name of the managedClusterSetBinding, and returns the corresponding managedClusterSetBinding object, and an error if there is any. -func (c *managedClusterSetBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManagedClusterSetBinding, err error) { - result = &v1alpha1.ManagedClusterSetBinding{} +func (c *managedClusterSetBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSetBinding, err error) { + result = &v1beta2.ManagedClusterSetBinding{} err = c.client.Get(). Namespace(c.ns). Resource("managedclustersetbindings"). @@ -61,12 +62,12 @@ func (c *managedClusterSetBindings) Get(ctx context.Context, name string, option } // List takes label and field selectors, and returns the list of ManagedClusterSetBindings that match those selectors. -func (c *managedClusterSetBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ManagedClusterSetBindingList, err error) { +func (c *managedClusterSetBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ManagedClusterSetBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.ManagedClusterSetBindingList{} + result = &v1beta2.ManagedClusterSetBindingList{} err = c.client.Get(). Namespace(c.ns). Resource("managedclustersetbindings"). @@ -93,8 +94,8 @@ func (c *managedClusterSetBindings) Watch(ctx context.Context, opts v1.ListOptio } // Create takes the representation of a managedClusterSetBinding and creates it. Returns the server's representation of the managedClusterSetBinding, and an error, if there is any. -func (c *managedClusterSetBindings) Create(ctx context.Context, managedClusterSetBinding *v1alpha1.ManagedClusterSetBinding, opts v1.CreateOptions) (result *v1alpha1.ManagedClusterSetBinding, err error) { - result = &v1alpha1.ManagedClusterSetBinding{} +func (c *managedClusterSetBindings) Create(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) { + result = &v1beta2.ManagedClusterSetBinding{} err = c.client.Post(). Namespace(c.ns). Resource("managedclustersetbindings"). @@ -106,8 +107,8 @@ func (c *managedClusterSetBindings) Create(ctx context.Context, managedClusterSe } // Update takes the representation of a managedClusterSetBinding and updates it. Returns the server's representation of the managedClusterSetBinding, and an error, if there is any. -func (c *managedClusterSetBindings) Update(ctx context.Context, managedClusterSetBinding *v1alpha1.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterSetBinding, err error) { - result = &v1alpha1.ManagedClusterSetBinding{} +func (c *managedClusterSetBindings) Update(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) { + result = &v1beta2.ManagedClusterSetBinding{} err = c.client.Put(). Namespace(c.ns). Resource("managedclustersetbindings"). @@ -119,6 +120,22 @@ func (c *managedClusterSetBindings) Update(ctx context.Context, managedClusterSe 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 *managedClusterSetBindings) UpdateStatus(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) { + result = &v1beta2.ManagedClusterSetBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("managedclustersetbindings"). + Name(managedClusterSetBinding.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(managedClusterSetBinding). + Do(ctx). + Into(result) + return +} + // Delete takes name of the managedClusterSetBinding and deletes it. Returns an error if one occurs. func (c *managedClusterSetBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). @@ -147,8 +164,8 @@ func (c *managedClusterSetBindings) DeleteCollection(ctx context.Context, opts v } // Patch applies the patch and returns the patched managedClusterSetBinding. -func (c *managedClusterSetBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterSetBinding, err error) { - result = &v1alpha1.ManagedClusterSetBinding{} +func (c *managedClusterSetBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSetBinding, err error) { + result = &v1beta2.ManagedClusterSetBinding{} err = c.client.Patch(pt). Namespace(c.ns). Resource("managedclustersetbindings"). diff --git a/vendor/open-cluster-management.io/api/client/operator/clientset/versioned/scheme/register.go b/vendor/open-cluster-management.io/api/client/operator/clientset/versioned/scheme/register.go index fdcc43188..1eeb27bcd 100644 --- a/vendor/open-cluster-management.io/api/client/operator/clientset/versioned/scheme/register.go +++ b/vendor/open-cluster-management.io/api/client/operator/clientset/versioned/scheme/register.go @@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // 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" -// ) +// 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) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go index 98ceb5090..b786f70dd 100644 --- a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go @@ -10,18 +10,21 @@ import ( rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" workv1 "open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1" + workv1alpha1 "open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1" ) type Interface interface { Discovery() discovery.DiscoveryInterface WorkV1() workv1.WorkV1Interface + WorkV1alpha1() workv1alpha1.WorkV1alpha1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - workV1 *workv1.WorkV1Client + workV1 *workv1.WorkV1Client + workV1alpha1 *workv1alpha1.WorkV1alpha1Client } // WorkV1 retrieves the WorkV1Client @@ -29,6 +32,11 @@ func (c *Clientset) WorkV1() workv1.WorkV1Interface { return c.workV1 } +// WorkV1alpha1 retrieves the WorkV1alpha1Client +func (c *Clientset) WorkV1alpha1() workv1alpha1.WorkV1alpha1Interface { + return c.workV1alpha1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -73,6 +81,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.workV1alpha1, err = workv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -95,6 +107,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.workV1 = workv1.New(c) + cs.workV1alpha1 = workv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/scheme/register.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/scheme/register.go index 85a759144..b41048ce4 100644 --- a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/scheme/register.go +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/scheme/register.go @@ -9,6 +9,7 @@ import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" workv1 "open-cluster-management.io/api/work/v1" + workv1alpha1 "open-cluster-management.io/api/work/v1alpha1" ) var Scheme = runtime.NewScheme() @@ -16,19 +17,20 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ workv1.AddToScheme, + workv1alpha1.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" -// ) +// 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) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/doc.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/doc.go new file mode 100644 index 000000000..93a7ca4e0 --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/generated_expansion.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..ce26c8afa --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/generated_expansion.go @@ -0,0 +1,5 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type PlaceManifestWorkExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/placemanifestwork.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/placemanifestwork.go new file mode 100644 index 000000000..1d9501b2d --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/placemanifestwork.go @@ -0,0 +1,179 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + 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" + scheme "open-cluster-management.io/api/client/work/clientset/versioned/scheme" + v1alpha1 "open-cluster-management.io/api/work/v1alpha1" +) + +// PlaceManifestWorksGetter has a method to return a PlaceManifestWorkInterface. +// A group's client should implement this interface. +type PlaceManifestWorksGetter interface { + PlaceManifestWorks(namespace string) PlaceManifestWorkInterface +} + +// PlaceManifestWorkInterface has methods to work with PlaceManifestWork resources. +type PlaceManifestWorkInterface interface { + Create(ctx context.Context, placeManifestWork *v1alpha1.PlaceManifestWork, opts v1.CreateOptions) (*v1alpha1.PlaceManifestWork, error) + Update(ctx context.Context, placeManifestWork *v1alpha1.PlaceManifestWork, opts v1.UpdateOptions) (*v1alpha1.PlaceManifestWork, error) + UpdateStatus(ctx context.Context, placeManifestWork *v1alpha1.PlaceManifestWork, opts v1.UpdateOptions) (*v1alpha1.PlaceManifestWork, 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.PlaceManifestWork, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PlaceManifestWorkList, 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.PlaceManifestWork, err error) + PlaceManifestWorkExpansion +} + +// placeManifestWorks implements PlaceManifestWorkInterface +type placeManifestWorks struct { + client rest.Interface + ns string +} + +// newPlaceManifestWorks returns a PlaceManifestWorks +func newPlaceManifestWorks(c *WorkV1alpha1Client, namespace string) *placeManifestWorks { + return &placeManifestWorks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the placeManifestWork, and returns the corresponding placeManifestWork object, and an error if there is any. +func (c *placeManifestWorks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PlaceManifestWork, err error) { + result = &v1alpha1.PlaceManifestWork{} + err = c.client.Get(). + Namespace(c.ns). + Resource("placemanifestworks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PlaceManifestWorks that match those selectors. +func (c *placeManifestWorks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PlaceManifestWorkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PlaceManifestWorkList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("placemanifestworks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested placeManifestWorks. +func (c *placeManifestWorks) 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("placemanifestworks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a placeManifestWork and creates it. Returns the server's representation of the placeManifestWork, and an error, if there is any. +func (c *placeManifestWorks) Create(ctx context.Context, placeManifestWork *v1alpha1.PlaceManifestWork, opts v1.CreateOptions) (result *v1alpha1.PlaceManifestWork, err error) { + result = &v1alpha1.PlaceManifestWork{} + err = c.client.Post(). + Namespace(c.ns). + Resource("placemanifestworks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(placeManifestWork). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a placeManifestWork and updates it. Returns the server's representation of the placeManifestWork, and an error, if there is any. +func (c *placeManifestWorks) Update(ctx context.Context, placeManifestWork *v1alpha1.PlaceManifestWork, opts v1.UpdateOptions) (result *v1alpha1.PlaceManifestWork, err error) { + result = &v1alpha1.PlaceManifestWork{} + err = c.client.Put(). + Namespace(c.ns). + Resource("placemanifestworks"). + Name(placeManifestWork.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(placeManifestWork). + 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 *placeManifestWorks) UpdateStatus(ctx context.Context, placeManifestWork *v1alpha1.PlaceManifestWork, opts v1.UpdateOptions) (result *v1alpha1.PlaceManifestWork, err error) { + result = &v1alpha1.PlaceManifestWork{} + err = c.client.Put(). + Namespace(c.ns). + Resource("placemanifestworks"). + Name(placeManifestWork.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(placeManifestWork). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the placeManifestWork and deletes it. Returns an error if one occurs. +func (c *placeManifestWorks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("placemanifestworks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *placeManifestWorks) 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("placemanifestworks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched placeManifestWork. +func (c *placeManifestWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PlaceManifestWork, err error) { + result = &v1alpha1.PlaceManifestWork{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("placemanifestworks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/work_client.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/work_client.go new file mode 100644 index 000000000..31b7c7779 --- /dev/null +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1alpha1/work_client.go @@ -0,0 +1,91 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + "open-cluster-management.io/api/client/work/clientset/versioned/scheme" + v1alpha1 "open-cluster-management.io/api/work/v1alpha1" +) + +type WorkV1alpha1Interface interface { + RESTClient() rest.Interface + PlaceManifestWorksGetter +} + +// WorkV1alpha1Client is used to interact with features provided by the work.open-cluster-management.io group. +type WorkV1alpha1Client struct { + restClient rest.Interface +} + +func (c *WorkV1alpha1Client) PlaceManifestWorks(namespace string) PlaceManifestWorkInterface { + return newPlaceManifestWorks(c, namespace) +} + +// NewForConfig creates a new WorkV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*WorkV1alpha1Client, 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 WorkV1alpha1Client 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) (*WorkV1alpha1Client, 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 &WorkV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new WorkV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *WorkV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new WorkV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *WorkV1alpha1Client { + return &WorkV1alpha1Client{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 *WorkV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml deleted file mode 100644 index 402ac242e..000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: managedclustersets.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: ManagedClusterSet - listKind: ManagedClusterSetList - plural: managedclustersets - shortNames: - - mclset - - mclsets - singular: managedclusterset - scope: Cluster - preserveUnknownFields: false - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ManagedClusterSet - type: object - status: - description: Status represents the current status of the ManagedClusterSet - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSet. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml deleted file mode 100644 index 5e0f47d17..000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: managedclustersetbindings.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: ManagedClusterSetBinding - listKind: ManagedClusterSetBindingList - plural: managedclustersetbindings - shortNames: - - mclsetbinding - - mclsetbindings - singular: managedclustersetbinding - scope: Namespaced - preserveUnknownFields: false - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of ManagedClusterSetBinding. - type: object - properties: - clusterSet: - description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. - type: string - minLength: 1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml index 0f5b20f73..16f883993 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml @@ -15,7 +15,7 @@ spec: - name: v1alpha1 schema: openAPIV3Schema: - description: ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub. + description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub." type: object properties: apiVersion: diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_03_clusters.open-cluster-management.io_placements.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_03_clusters.open-cluster-management.io_placements.crd.yaml deleted file mode 100644 index c8c53f4ab..000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_03_clusters.open-cluster-management.io_placements.crd.yaml +++ /dev/null @@ -1,265 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: placements.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: Placement - listKind: PlacementList - plural: placements - singular: placement - scope: Namespaced - preserveUnknownFields: false - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].status - name: Succeeded - type: string - - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].reason - name: Reason - type: string - - jsonPath: .status.numberOfSelectedClusters - name: SelectedClusters - type: integer - name: v1alpha1 - schema: - openAPIV3Schema: - description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n Here is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3) ManagedClusterSets are bound to workload namespaces; 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters; 5) Then Placements subselect from that working set using label/claim selection. \n No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. \n A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement. \n If a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly." - type: object - required: - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of Placement. - type: object - properties: - clusterSets: - description: ClusterSets represent the ManagedClusterSets from which the ManagedClusters are selected. If the slice is empty, ManagedClusters will be selected from the ManagedClusterSets bound to the placement namespace, otherwise ManagedClusters will be selected from the intersection of this slice and the ManagedClusterSets bound to the placement namespace. - type: array - items: - type: string - numberOfClusters: - description: NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the placement requirements. 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets, and Predicates) will be selected; 2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than NumberOfClusters, a random subset with desired number of ManagedClusters will be selected; 3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters, all of them will be selected; 4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters, all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be set to false; - type: integer - format: int32 - predicates: - description: Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed. - type: array - items: - description: ClusterPredicate represents a predicate to select ManagedClusters. - type: object - properties: - requiredClusterSelector: - description: RequiredClusterSelector represents a selector of ManagedClusters by label and claim. If specified, 1) Any ManagedCluster, which does not match the selector, should not be selected by this ClusterPredicate; 2) If a selected ManagedCluster (of this ClusterPredicate) ceases to match the selector (e.g. due to an update) of any ClusterPredicate, it will be eventually removed from the placement decisions; 3) If a ManagedCluster (not selected previously) starts to match the selector, it will either be selected or at least has a chance to be selected (when NumberOfClusters is specified); - type: object - properties: - claimSelector: - description: ClaimSelector represents a selector of ManagedClusters by clusterClaims in status - type: object - properties: - matchExpressions: - description: matchExpressions is a list of cluster claim selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - labelSelector: - description: LabelSelector represents a selector of ManagedClusters by label - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - prioritizerPolicy: - description: PrioritizerPolicy defines the policy of the prioritizers. If this field is unset, then default prioritizer mode and configurations are used. Referring to PrioritizerPolicy to see more description about Mode and Configurations. - type: object - properties: - configurations: - type: array - items: - description: PrioritizerConfig represents the configuration of prioritizer - type: object - properties: - name: - description: 'Name will be removed in v1beta1 and replaced by ScoreCoordinate.BuiltIn. If both Name and ScoreCoordinate.BuiltIn are defined, will use the value in ScoreCoordinate.BuiltIn. Name is the name of a prioritizer. Below are the valid names: 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.' - type: string - scoreCoordinate: - description: ScoreCoordinate represents the configuration of the prioritizer and score source. - type: object - required: - - type - properties: - addOn: - description: When type is "AddOn", AddOn defines the resource name and score name. - type: object - required: - - resourceName - - scoreName - properties: - resourceName: - description: ResourceName defines the resource name of the AddOnPlacementScore. The placement prioritizer selects AddOnPlacementScore CR by this name. - type: string - scoreName: - description: ScoreName defines the score name inside AddOnPlacementScore. AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by the prioritizer. - type: string - builtIn: - description: 'BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.' - type: string - type: - description: Type defines the type of the prioritizer score. Type is either "BuiltIn", "AddOn" or "", where "" is "BuiltIn" by default. When the type is "BuiltIn", need to specify a BuiltIn prioritizer name in BuiltIn. When the type is "AddOn", need to configure the score source in AddOn. - type: string - default: BuiltIn - enum: - - BuiltIn - - AddOn - weight: - description: Weight defines the weight of the prioritizer score. The value must be ranged in [-10,10]. Each prioritizer will calculate an integer score of a cluster in the range of [-100, 100]. The final score of a cluster will be sum(weight * prioritizer_score). A higher weight indicates that the prioritizer weights more in the cluster selection, while 0 weight indicates that the prioritizer is disabled. A negative weight indicates wants to select the last ones. - type: integer - format: int32 - default: 1 - maximum: 10 - minimum: -10 - mode: - description: Mode is either Exact, Additive, "" where "" is Additive by default. In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations, in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0. Additive doesn't require configuring all prioritizers. The default Configurations may change in the future, and additional prioritization will happen. In Exact mode, any prioritizer not explicitly enumerated is weighted as zero. Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases. - type: string - default: Additive - tolerations: - description: Tolerations are applied to placements, and allow (but do not require) the managed clusters with certain taints to be selected by placements with matching tolerations. - type: array - items: - description: Toleration represents the toleration object that can be attached to a placement. The placement this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSelect, PreferNoSelect and NoSelectIfNew. - type: string - enum: - - NoSelect - - PreferNoSelect - - NoSelectIfNew - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a placement can tolerate all taints of a particular category. - type: string - default: Equal - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoSelect/PreferNoSelect, otherwise this field is ignored) tolerates the taint. The default value is nil, which indicates it tolerates the taint forever. The start time of counting the TolerationSeconds should be the TimeAdded in Taint, not the cluster scheduled time or TolerationSeconds added time. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - maxLength: 1024 - status: - description: Status represents the current status of the Placement - type: object - properties: - conditions: - description: Conditions contains the different condition status for this Placement. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - numberOfSelectedClusters: - description: NumberOfSelectedClusters represents the number of selected ManagedClusters - type: integer - format: int32 - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_04_clusters.open-cluster-management.io_placementdecisions.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_04_clusters.open-cluster-management.io_placementdecisions.crd.yaml deleted file mode 100644 index 9cab8eb6d..000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_04_clusters.open-cluster-management.io_placementdecisions.crd.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: placementdecisions.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: PlacementDecision - listKind: PlacementDecisionList - plural: placementdecisions - singular: placementdecision - scope: Namespaced - preserveUnknownFields: false - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: "PlacementDecision indicates a decision from a placement PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name} to reference a certain placement. \n If a placement has spec.numberOfClusters specified, the total number of decisions contained in status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total number of decisions should be the number of ManagedClusters which match the placement requirements. \n Some of the decisions might be empty when there are no enough ManagedClusters meet the placement requirements." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - description: Status represents the current status of the PlacementDecision - type: object - required: - - decisions - properties: - decisions: - description: Decisions is a slice of decisions according to a placement The number of decisions should not be larger than 100 - type: array - items: - description: ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet. - type: object - required: - - clusterName - - reason - properties: - clusterName: - description: ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all placement decisions for the Placement. - type: string - reason: - description: Reason represents the reason why the ManagedCluster is selected. - type: string - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml index 2df656861..bba98c653 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml @@ -13,7 +13,7 @@ spec: preserveUnknownFields: false validation: openAPIV3Schema: - description: ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub. + description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub." type: object properties: apiVersion: diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go index 480f4883f..36b73ce2f 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go @@ -32,16 +32,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(GroupVersion, &AddOnPlacementScore{}, &AddOnPlacementScoreList{}, - &ManagedClusterSet{}, - &ManagedClusterSetList{}, - &ManagedClusterSetBinding{}, - &ManagedClusterSetBindingList{}, &ClusterClaim{}, &ClusterClaimList{}, - &Placement{}, - &PlacementList{}, - &PlacementDecision{}, - &PlacementDecisionList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) return nil diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/types.go index 4be2d776c..6cb57bc3b 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types.go +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/types.go @@ -2,110 +2,8 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "open-cluster-management.io/api/cluster/v1" ) -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope="Cluster",shortName={"mclset","mclsets"} - -// ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. -// A workload can be defined to deployed on a ManagedClusterSet, which mean: -// 1. The workload can run on any ManagedCluster in the ManagedClusterSet -// 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet -// 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet -// -// In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name -// `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. -// User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on -// a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission -// on both the old and new ManagedClusterSet. -type ManagedClusterSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the attributes of the ManagedClusterSet - Spec ManagedClusterSetSpec `json:"spec"` - - // Status represents the current status of the ManagedClusterSet - // +optional - Status ManagedClusterSetStatus `json:"status,omitempty"` -} - -// ManagedClusterSetSpec describes the attributes of the ManagedClusterSet -type ManagedClusterSetSpec struct { -} - -// ManagedClusterSetStatus represents the current status of the ManagedClusterSet. -type ManagedClusterSetStatus struct { - // Conditions contains the different condition statuses for this ManagedClusterSet. - Conditions []metav1.Condition `json:"conditions"` -} - -const ( - // ManagedClusterSetConditionEmpty means no ManagedCluster is included in the - // ManagedClusterSet. - ManagedClusterSetConditionEmpty string = "ClusterSetEmpty" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ManagedClusterSetList is a collection of ManagedClusterSet. -type ManagedClusterSetList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // Items is a list of ManagedClusterSet. - Items []ManagedClusterSet `json:"items"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:scope="Namespaced",shortName={"mclsetbinding","mclsetbindings"} - -// ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. -// User is able to create a ManagedClusterSetBinding in a namespace and bind it to a -// ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of -// managedclustersets/bind. Workloads created in the same namespace can only be -// distributed to ManagedClusters in ManagedClusterSets bound in this namespace by -// higher level controllers. -type ManagedClusterSetBinding struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the attributes of ManagedClusterSetBinding. - Spec ManagedClusterSetBindingSpec `json:"spec"` -} - -// ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding. -type ManagedClusterSetBindingSpec struct { - // ClusterSet is the name of the ManagedClusterSet to bind. It must match the - // instance name of the ManagedClusterSetBinding and cannot change once created. - // User is allowed to set this field if they have an RBAC rule to CREATE on the - // virtual subresource of managedclustersets/bind. - // +kubebuilder:validation:MinLength=1 - ClusterSet string `json:"clusterSet"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding. -type ManagedClusterSetBindingList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // Items is a list of ManagedClusterSetBinding. - Items []ManagedClusterSetBinding `json:"items"` -} - // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -113,9 +11,10 @@ type ManagedClusterSetBindingList struct { // ClusterClaim represents cluster information that a managed cluster claims // ClusterClaims with well known names include, -// 1. id.k8s.io, it contains a unique identifier for the cluster. -// 2. clusterset.k8s.io, it contains an identifier that relates the cluster -// to the ClusterSet in which it belongs. +// 1. id.k8s.io, it contains a unique identifier for the cluster. +// 2. clusterset.k8s.io, it contains an identifier that relates the cluster +// to the ClusterSet in which it belongs. +// // ClusterClaims created on a managed cluster will be collected and saved into // the status of the corresponding ManagedCluster on hub. type ClusterClaim struct { @@ -160,367 +59,3 @@ var ReservedClusterClaimNames = [...]string{ // product name, like OpenShift, Anthos, EKS and GKE "product.open-cluster-management.io", } - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:scope="Namespaced" -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Succeeded",type="string",JSONPath=".status.conditions[?(@.type==\"PlacementSatisfied\")].status" -// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type==\"PlacementSatisfied\")].reason" -// +kubebuilder:printcolumn:name="SelectedClusters",type="integer",JSONPath=".status.numberOfSelectedClusters" - -// Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound -// to the placement namespace. -// -// Here is how the placement policy combines with other selection methods to determine a matching -// list of ManagedClusters: -// 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; -// 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; -// 3) ManagedClusterSets are bound to workload namespaces; -// 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set -// of potential ManagedClusters; -// 5) Then Placements subselect from that working set using label/claim selection. -// -// No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement -// namespace. User is able to bind a ManagedClusterSet to a namespace by creating a -// ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual -// subresource of `managedclustersets/bind`. -// -// A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} -// will be created to represent the ManagedClusters selected by this placement. -// -// If a ManagedCluster is selected and added into the PlacementDecisions, other components may -// apply workload on it; once it is removed from the PlacementDecisions, the workload applied on -// this ManagedCluster should be evicted accordingly. -type Placement struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the attributes of Placement. - // +kubebuilder:validation:Required - // +required - Spec PlacementSpec `json:"spec"` - - // Status represents the current status of the Placement - // +optional - Status PlacementStatus `json:"status,omitempty"` -} - -// PlacementSpec defines the attributes of Placement. -// An empty PlacementSpec selects all ManagedClusters from the ManagedClusterSets bound to -// the placement namespace. The containing fields are ANDed. -type PlacementSpec struct { - // ClusterSets represent the ManagedClusterSets from which the ManagedClusters are selected. - // If the slice is empty, ManagedClusters will be selected from the ManagedClusterSets bound to the placement - // namespace, otherwise ManagedClusters will be selected from the intersection of this slice and the - // ManagedClusterSets bound to the placement namespace. - // +optional - ClusterSets []string `json:"clusterSets,omitempty"` - - // NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the - // placement requirements. - // 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets, - // and Predicates) will be selected; - // 2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than - // NumberOfClusters, a random subset with desired number of ManagedClusters will be selected; - // 3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters, - // all of them will be selected; - // 4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters, - // all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be - // set to false; - // +optional - NumberOfClusters *int32 `json:"numberOfClusters,omitempty"` - - // Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed. - // +optional - Predicates []ClusterPredicate `json:"predicates,omitempty"` - - // PrioritizerPolicy defines the policy of the prioritizers. - // If this field is unset, then default prioritizer mode and configurations are used. - // Referring to PrioritizerPolicy to see more description about Mode and Configurations. - // +optional - PrioritizerPolicy PrioritizerPolicy `json:"prioritizerPolicy"` - - // Tolerations are applied to placements, and allow (but do not require) the managed clusters with - // certain taints to be selected by placements with matching tolerations. - // +optional - Tolerations []Toleration `json:"tolerations,omitempty"` -} - -// ClusterPredicate represents a predicate to select ManagedClusters. -type ClusterPredicate struct { - // RequiredClusterSelector represents a selector of ManagedClusters by label and claim. If specified, - // 1) Any ManagedCluster, which does not match the selector, should not be selected by this ClusterPredicate; - // 2) If a selected ManagedCluster (of this ClusterPredicate) ceases to match the selector (e.g. due to - // an update) of any ClusterPredicate, it will be eventually removed from the placement decisions; - // 3) If a ManagedCluster (not selected previously) starts to match the selector, it will either - // be selected or at least has a chance to be selected (when NumberOfClusters is specified); - // +optional - RequiredClusterSelector ClusterSelector `json:"requiredClusterSelector,omitempty"` -} - -// ClusterSelector represents the AND of the containing selectors. An empty cluster selector matches all objects. -// A null cluster selector matches no objects. -type ClusterSelector struct { - // LabelSelector represents a selector of ManagedClusters by label - // +optional - LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"` - - // ClaimSelector represents a selector of ManagedClusters by clusterClaims in status - // +optional - ClaimSelector ClusterClaimSelector `json:"claimSelector,omitempty"` -} - -// ClusterClaimSelector is a claim query over a set of ManagedClusters. An empty cluster claim -// selector matches all objects. A null cluster claim selector matches no objects. -type ClusterClaimSelector struct { - // matchExpressions is a list of cluster claim selector requirements. The requirements are ANDed. - // +optional - MatchExpressions []metav1.LabelSelectorRequirement `json:"matchExpressions,omitempty"` -} - -// PrioritizerPolicy represents the policy of prioritizer -type PrioritizerPolicy struct { - // Mode is either Exact, Additive, "" where "" is Additive by default. - // In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations, - // in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0. - // Additive doesn't require configuring all prioritizers. The default Configurations may change in the future, - // and additional prioritization will happen. - // In Exact mode, any prioritizer not explicitly enumerated is weighted as zero. - // Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases. - // +kubebuilder:default:=Additive - // +optional - Mode PrioritizerPolicyModeType `json:"mode,omitempty"` - - // +optional - Configurations []PrioritizerConfig `json:"configurations,omitempty"` -} - -// PrioritizerPolicyModeType represents the type of PrioritizerPolicy.Mode -type PrioritizerPolicyModeType string - -const ( - // Valid PrioritizerPolicyModeType value is Exact, Additive. - PrioritizerPolicyModeAdditive PrioritizerPolicyModeType = "Additive" - PrioritizerPolicyModeExact PrioritizerPolicyModeType = "Exact" -) - -// PrioritizerConfig represents the configuration of prioritizer -type PrioritizerConfig struct { - // Name will be removed in v1beta1 and replaced by ScoreCoordinate.BuiltIn. - // If both Name and ScoreCoordinate.BuiltIn are defined, will use the value - // in ScoreCoordinate.BuiltIn. - // Name is the name of a prioritizer. Below are the valid names: - // 1) Balance: balance the decisions among the clusters. - // 2) Steady: ensure the existing decision is stabilized. - // 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable. - // +optional - Name string `json:"name,omitempty"` - - // ScoreCoordinate represents the configuration of the prioritizer and score source. - // +optional - ScoreCoordinate *ScoreCoordinate `json:"scoreCoordinate,omitempty"` - - // Weight defines the weight of the prioritizer score. The value must be ranged in [-10,10]. - // Each prioritizer will calculate an integer score of a cluster in the range of [-100, 100]. - // The final score of a cluster will be sum(weight * prioritizer_score). - // A higher weight indicates that the prioritizer weights more in the cluster selection, - // while 0 weight indicates that the prioritizer is disabled. A negative weight indicates - // wants to select the last ones. - // +kubebuilder:validation:Minimum:=-10 - // +kubebuilder:validation:Maximum:=10 - // +kubebuilder:default:=1 - // +optional - Weight int32 `json:"weight,omitempty"` -} - -// ScoreCoordinate represents the configuration of the score type and score source -type ScoreCoordinate struct { - // Type defines the type of the prioritizer score. - // Type is either "BuiltIn", "AddOn" or "", where "" is "BuiltIn" by default. - // When the type is "BuiltIn", need to specify a BuiltIn prioritizer name in BuiltIn. - // When the type is "AddOn", need to configure the score source in AddOn. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=BuiltIn;AddOn - // +kubebuilder:default:=BuiltIn - // +required - Type string `json:"type,omitempty"` - - // BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. - // 1) Balance: balance the decisions among the clusters. - // 2) Steady: ensure the existing decision is stabilized. - // 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable. - // +optional - BuiltIn string `json:"builtIn,omitempty"` - - // When type is "AddOn", AddOn defines the resource name and score name. - // +optional - AddOn *AddOnScore `json:"addOn,omitempty"` -} - -const ( - // Valid ScoreCoordinate type is BuiltIn, AddOn. - ScoreCoordinateTypeBuiltIn string = "BuiltIn" - ScoreCoordinateTypeAddOn string = "AddOn" -) - -// AddOnScore represents the configuration of the addon score source. -type AddOnScore struct { - // ResourceName defines the resource name of the AddOnPlacementScore. - // The placement prioritizer selects AddOnPlacementScore CR by this name. - // +kubebuilder:validation:Required - // +required - ResourceName string `json:"resourceName"` - - // ScoreName defines the score name inside AddOnPlacementScore. - // AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by - // the prioritizer. - // +kubebuilder:validation:Required - // +required - ScoreName string `json:"scoreName"` -} - -// Toleration represents the toleration object that can be attached to a placement. -// The placement this Toleration is attached to tolerates any taint that matches -// the triple using the matching operator . -type Toleration struct { - // Key is the taint key that the toleration applies to. Empty means match all taint keys. - // If the key is empty, operator must be Exists; this combination means to match all values and all keys. - // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` - // +kubebuilder:validation:MaxLength=316 - // +optional - Key string `json:"key,omitempty"` - // Operator represents a key's relationship to the value. - // Valid operators are Exists and Equal. Defaults to Equal. - // Exists is equivalent to wildcard for value, so that a placement can - // tolerate all taints of a particular category. - // +kubebuilder:default:="Equal" - // +optional - Operator TolerationOperator `json:"operator,omitempty"` - // Value is the taint value the toleration matches to. - // If the operator is Exists, the value should be empty, otherwise just a regular string. - // +kubebuilder:validation:MaxLength=1024 - // +optional - Value string `json:"value,omitempty"` - // Effect indicates the taint effect to match. Empty means match all taint effects. - // When specified, allowed values are NoSelect, PreferNoSelect and NoSelectIfNew. - // +kubebuilder:validation:Enum:=NoSelect;PreferNoSelect;NoSelectIfNew - // +optional - Effect v1.TaintEffect `json:"effect,omitempty"` - // TolerationSeconds represents the period of time the toleration (which must be of effect - // NoSelect/PreferNoSelect, otherwise this field is ignored) tolerates the taint. - // The default value is nil, which indicates it tolerates the taint forever. - // The start time of counting the TolerationSeconds should be the TimeAdded in Taint, not the cluster - // scheduled time or TolerationSeconds added time. - // +optional - TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` -} - -// TolerationOperator is the set of operators that can be used in a toleration. -type TolerationOperator string - -// These are valid values for TolerationOperator -const ( - TolerationOpExists TolerationOperator = "Exists" - TolerationOpEqual TolerationOperator = "Equal" -) - -type PlacementStatus struct { - // NumberOfSelectedClusters represents the number of selected ManagedClusters - // +optional - NumberOfSelectedClusters int32 `json:"numberOfSelectedClusters"` - - // Conditions contains the different condition status for this Placement. - // +optional - Conditions []metav1.Condition `json:"conditions"` -} - -const ( - // PlacementConditionSatisfied means Placement requirements are satisfied. - // A placement is not satisfied only if there is empty ClusterDecision in the status.decisions - // of PlacementDecisions. - PlacementConditionSatisfied string = "PlacementSatisfied" - // PlacementConditionMisconfigured means Placement configuration is incorrect. - PlacementConditionMisconfigured string = "PlacementMisconfigured" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PlacementList is a collection of Placements. -type PlacementList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // Items is a list of Placements. - Items []Placement `json:"items"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:scope="Namespaced" -// +kubebuilder:subresource:status - -// PlacementDecision indicates a decision from a placement -// PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name} -// to reference a certain placement. -// -// If a placement has spec.numberOfClusters specified, the total number of decisions contained in -// status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total -// number of decisions should be the number of ManagedClusters which match the placement requirements. -// -// Some of the decisions might be empty when there are no enough ManagedClusters meet the placement -// requirements. -type PlacementDecision struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Status represents the current status of the PlacementDecision - // +optional - Status PlacementDecisionStatus `json:"status,omitempty"` -} - -//The placementDecsion label name holding the placement name -const ( - PlacementLabel string = "cluster.open-cluster-management.io/placement" -) - -// PlacementDecisionStatus represents the current status of the PlacementDecision. -type PlacementDecisionStatus struct { - // Decisions is a slice of decisions according to a placement - // The number of decisions should not be larger than 100 - // +kubebuilder:validation:Required - // +required - Decisions []ClusterDecision `json:"decisions"` -} - -// ClusterDecision represents a decision from a placement -// An empty ClusterDecision indicates it is not scheduled yet. -type ClusterDecision struct { - // ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all - // placement decisions for the Placement. - // +kubebuilder:validation:Required - // +required - ClusterName string `json:"clusterName"` - - // Reason represents the reason why the ManagedCluster is selected. - // +kubebuilder:validation:Required - // +required - Reason string `json:"reason"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterDecisionList is a collection of PlacementDecision. -type PlacementDecisionList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // Items is a list of PlacementDecision. - Items []PlacementDecision `json:"items"` -} diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_addonplacementscore.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_addonplacementscore.go index 039750c33..1ce73580b 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_addonplacementscore.go +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_addonplacementscore.go @@ -20,7 +20,7 @@ type AddOnPlacementScore struct { Status AddOnPlacementScoreStatus `json:"status,omitempty"` } -//AddOnPlacementScoreStatus represents the current status of AddOnPlacementScore. +// AddOnPlacementScoreStatus represents the current status of AddOnPlacementScore. type AddOnPlacementScoreStatus struct { // Conditions contain the different condition statuses for this AddOnPlacementScore. // +patchMergeKey=type @@ -45,7 +45,7 @@ type AddOnPlacementScoreStatus struct { ValidUntil *metav1.Time `json:"validUntil"` } -//AddOnPlacementScoreItem represents the score name and value. +// AddOnPlacementScoreItem represents the score name and value. type AddOnPlacementScoreItem struct { // Name is the name of the score // +kubebuilder:validation:Required diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.deepcopy.go index 5f41cf881..fd4fa6bee 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.deepcopy.go @@ -118,22 +118,6 @@ func (in *AddOnPlacementScoreStatus) DeepCopy() *AddOnPlacementScoreStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AddOnScore) DeepCopyInto(out *AddOnScore) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnScore. -func (in *AddOnScore) DeepCopy() *AddOnScore { - if in == nil { - return nil - } - out := new(AddOnScore) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterClaim) DeepCopyInto(out *ClusterClaim) { *out = *in @@ -194,29 +178,6 @@ func (in *ClusterClaimList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterClaimSelector) DeepCopyInto(out *ClusterClaimSelector) { - *out = *in - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]v1.LabelSelectorRequirement, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClaimSelector. -func (in *ClusterClaimSelector) DeepCopy() *ClusterClaimSelector { - if in == nil { - return nil - } - out := new(ClusterClaimSelector) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterClaimSpec) DeepCopyInto(out *ClusterClaimSpec) { *out = *in @@ -232,522 +193,3 @@ func (in *ClusterClaimSpec) DeepCopy() *ClusterClaimSpec { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterDecision) DeepCopyInto(out *ClusterDecision) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDecision. -func (in *ClusterDecision) DeepCopy() *ClusterDecision { - if in == nil { - return nil - } - out := new(ClusterDecision) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterPredicate) DeepCopyInto(out *ClusterPredicate) { - *out = *in - in.RequiredClusterSelector.DeepCopyInto(&out.RequiredClusterSelector) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPredicate. -func (in *ClusterPredicate) DeepCopy() *ClusterPredicate { - if in == nil { - return nil - } - out := new(ClusterPredicate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector) { - *out = *in - in.LabelSelector.DeepCopyInto(&out.LabelSelector) - in.ClaimSelector.DeepCopyInto(&out.ClaimSelector) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelector. -func (in *ClusterSelector) DeepCopy() *ClusterSelector { - if in == nil { - return nil - } - out := new(ClusterSelector) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedClusterSet) DeepCopyInto(out *ManagedClusterSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSet. -func (in *ManagedClusterSet) DeepCopy() *ManagedClusterSet { - if in == nil { - return nil - } - out := new(ManagedClusterSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ManagedClusterSet) 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 *ManagedClusterSetBinding) DeepCopyInto(out *ManagedClusterSetBinding) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBinding. -func (in *ManagedClusterSetBinding) DeepCopy() *ManagedClusterSetBinding { - if in == nil { - return nil - } - out := new(ManagedClusterSetBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ManagedClusterSetBinding) 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 *ManagedClusterSetBindingList) DeepCopyInto(out *ManagedClusterSetBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ManagedClusterSetBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBindingList. -func (in *ManagedClusterSetBindingList) DeepCopy() *ManagedClusterSetBindingList { - if in == nil { - return nil - } - out := new(ManagedClusterSetBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ManagedClusterSetBindingList) 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 *ManagedClusterSetBindingSpec) DeepCopyInto(out *ManagedClusterSetBindingSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBindingSpec. -func (in *ManagedClusterSetBindingSpec) DeepCopy() *ManagedClusterSetBindingSpec { - if in == nil { - return nil - } - out := new(ManagedClusterSetBindingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedClusterSetList) DeepCopyInto(out *ManagedClusterSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ManagedClusterSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetList. -func (in *ManagedClusterSetList) DeepCopy() *ManagedClusterSetList { - if in == nil { - return nil - } - out := new(ManagedClusterSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ManagedClusterSetList) 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 *ManagedClusterSetSpec) DeepCopyInto(out *ManagedClusterSetSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetSpec. -func (in *ManagedClusterSetSpec) DeepCopy() *ManagedClusterSetSpec { - if in == nil { - return nil - } - out := new(ManagedClusterSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedClusterSetStatus) DeepCopyInto(out *ManagedClusterSetStatus) { - *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 ManagedClusterSetStatus. -func (in *ManagedClusterSetStatus) DeepCopy() *ManagedClusterSetStatus { - if in == nil { - return nil - } - out := new(ManagedClusterSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Placement) DeepCopyInto(out *Placement) { - *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 Placement. -func (in *Placement) DeepCopy() *Placement { - if in == nil { - return nil - } - out := new(Placement) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Placement) 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 *PlacementDecision) DeepCopyInto(out *PlacementDecision) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementDecision. -func (in *PlacementDecision) DeepCopy() *PlacementDecision { - if in == nil { - return nil - } - out := new(PlacementDecision) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PlacementDecision) 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 *PlacementDecisionList) DeepCopyInto(out *PlacementDecisionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PlacementDecision, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementDecisionList. -func (in *PlacementDecisionList) DeepCopy() *PlacementDecisionList { - if in == nil { - return nil - } - out := new(PlacementDecisionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PlacementDecisionList) 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 *PlacementDecisionStatus) DeepCopyInto(out *PlacementDecisionStatus) { - *out = *in - if in.Decisions != nil { - in, out := &in.Decisions, &out.Decisions - *out = make([]ClusterDecision, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementDecisionStatus. -func (in *PlacementDecisionStatus) DeepCopy() *PlacementDecisionStatus { - if in == nil { - return nil - } - out := new(PlacementDecisionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PlacementList) DeepCopyInto(out *PlacementList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Placement, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementList. -func (in *PlacementList) DeepCopy() *PlacementList { - if in == nil { - return nil - } - out := new(PlacementList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PlacementList) 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 *PlacementSpec) DeepCopyInto(out *PlacementSpec) { - *out = *in - if in.ClusterSets != nil { - in, out := &in.ClusterSets, &out.ClusterSets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NumberOfClusters != nil { - in, out := &in.NumberOfClusters, &out.NumberOfClusters - *out = new(int32) - **out = **in - } - if in.Predicates != nil { - in, out := &in.Predicates, &out.Predicates - *out = make([]ClusterPredicate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.PrioritizerPolicy.DeepCopyInto(&out.PrioritizerPolicy) - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementSpec. -func (in *PlacementSpec) DeepCopy() *PlacementSpec { - if in == nil { - return nil - } - out := new(PlacementSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PlacementStatus) DeepCopyInto(out *PlacementStatus) { - *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 PlacementStatus. -func (in *PlacementStatus) DeepCopy() *PlacementStatus { - if in == nil { - return nil - } - out := new(PlacementStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PrioritizerConfig) DeepCopyInto(out *PrioritizerConfig) { - *out = *in - if in.ScoreCoordinate != nil { - in, out := &in.ScoreCoordinate, &out.ScoreCoordinate - *out = new(ScoreCoordinate) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrioritizerConfig. -func (in *PrioritizerConfig) DeepCopy() *PrioritizerConfig { - if in == nil { - return nil - } - out := new(PrioritizerConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PrioritizerPolicy) DeepCopyInto(out *PrioritizerPolicy) { - *out = *in - if in.Configurations != nil { - in, out := &in.Configurations, &out.Configurations - *out = make([]PrioritizerConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrioritizerPolicy. -func (in *PrioritizerPolicy) DeepCopy() *PrioritizerPolicy { - if in == nil { - return nil - } - out := new(PrioritizerPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ScoreCoordinate) DeepCopyInto(out *ScoreCoordinate) { - *out = *in - if in.AddOn != nil { - in, out := &in.AddOn, &out.AddOn - *out = new(AddOnScore) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScoreCoordinate. -func (in *ScoreCoordinate) DeepCopy() *ScoreCoordinate { - if in == nil { - return nil - } - out := new(ScoreCoordinate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Toleration) DeepCopyInto(out *Toleration) { - *out = *in - if in.TolerationSeconds != nil { - in, out := &in.TolerationSeconds, &out.TolerationSeconds - *out = new(int64) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Toleration. -func (in *Toleration) DeepCopy() *Toleration { - if in == nil { - return nil - } - out := new(Toleration) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.swagger_doc_generated.go index bbf170962..864fc58e7 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.swagger_doc_generated.go @@ -11,18 +11,8 @@ package v1alpha1 // Those methods can be generated by using hack/update-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE -var map_AddOnScore = map[string]string{ - "": "AddOnScore represents the configuration of the addon score source.", - "resourceName": "ResourceName defines the resource name of the AddOnPlacementScore. The placement prioritizer selects AddOnPlacementScore CR by this name.", - "scoreName": "ScoreName defines the score name inside AddOnPlacementScore. AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by the prioritizer.", -} - -func (AddOnScore) SwaggerDoc() map[string]string { - return map_AddOnScore -} - var map_ClusterClaim = map[string]string{ - "": "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include,\n 1. id.k8s.io, it contains a unique identifier for the cluster.\n 2. clusterset.k8s.io, it contains an identifier that relates the cluster\n to the ClusterSet in which it belongs.\nClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.", + "": "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include,\n 1. id.k8s.io, it contains a unique identifier for the cluster.\n 2. clusterset.k8s.io, it contains an identifier that relates the cluster\n to the ClusterSet in which it belongs.\n\nClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.", "spec": "Spec defines the attributes of the ClusterClaim.", } @@ -40,15 +30,6 @@ func (ClusterClaimList) SwaggerDoc() map[string]string { return map_ClusterClaimList } -var map_ClusterClaimSelector = map[string]string{ - "": "ClusterClaimSelector is a claim query over a set of ManagedClusters. An empty cluster claim selector matches all objects. A null cluster claim selector matches no objects.", - "matchExpressions": "matchExpressions is a list of cluster claim selector requirements. The requirements are ANDed.", -} - -func (ClusterClaimSelector) SwaggerDoc() map[string]string { - return map_ClusterClaimSelector -} - var map_ClusterClaimSpec = map[string]string{ "value": "Value is a claim-dependent string", } @@ -57,214 +38,6 @@ func (ClusterClaimSpec) SwaggerDoc() map[string]string { return map_ClusterClaimSpec } -var map_ClusterDecision = map[string]string{ - "": "ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet.", - "clusterName": "ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all placement decisions for the Placement.", - "reason": "Reason represents the reason why the ManagedCluster is selected.", -} - -func (ClusterDecision) SwaggerDoc() map[string]string { - return map_ClusterDecision -} - -var map_ClusterPredicate = map[string]string{ - "": "ClusterPredicate represents a predicate to select ManagedClusters.", - "requiredClusterSelector": "RequiredClusterSelector represents a selector of ManagedClusters by label and claim. If specified, 1) Any ManagedCluster, which does not match the selector, should not be selected by this ClusterPredicate; 2) If a selected ManagedCluster (of this ClusterPredicate) ceases to match the selector (e.g. due to\n an update) of any ClusterPredicate, it will be eventually removed from the placement decisions;\n3) If a ManagedCluster (not selected previously) starts to match the selector, it will either\n be selected or at least has a chance to be selected (when NumberOfClusters is specified);", -} - -func (ClusterPredicate) SwaggerDoc() map[string]string { - return map_ClusterPredicate -} - -var map_ClusterSelector = map[string]string{ - "": "ClusterSelector represents the AND of the containing selectors. An empty cluster selector matches all objects. A null cluster selector matches no objects.", - "labelSelector": "LabelSelector represents a selector of ManagedClusters by label", - "claimSelector": "ClaimSelector represents a selector of ManagedClusters by clusterClaims in status", -} - -func (ClusterSelector) SwaggerDoc() map[string]string { - return map_ClusterSelector -} - -var map_ManagedClusterSet = map[string]string{ - "": "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet.", - "spec": "Spec defines the attributes of the ManagedClusterSet", - "status": "Status represents the current status of the ManagedClusterSet", -} - -func (ManagedClusterSet) SwaggerDoc() map[string]string { - return map_ManagedClusterSet -} - -var map_ManagedClusterSetBinding = map[string]string{ - "": "ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers.", - "spec": "Spec defines the attributes of ManagedClusterSetBinding.", -} - -func (ManagedClusterSetBinding) SwaggerDoc() map[string]string { - return map_ManagedClusterSetBinding -} - -var map_ManagedClusterSetBindingList = map[string]string{ - "": "ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of ManagedClusterSetBinding.", -} - -func (ManagedClusterSetBindingList) SwaggerDoc() map[string]string { - return map_ManagedClusterSetBindingList -} - -var map_ManagedClusterSetBindingSpec = map[string]string{ - "": "ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding.", - "clusterSet": "ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind.", -} - -func (ManagedClusterSetBindingSpec) SwaggerDoc() map[string]string { - return map_ManagedClusterSetBindingSpec -} - -var map_ManagedClusterSetList = map[string]string{ - "": "ManagedClusterSetList is a collection of ManagedClusterSet.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of ManagedClusterSet.", -} - -func (ManagedClusterSetList) SwaggerDoc() map[string]string { - return map_ManagedClusterSetList -} - -var map_ManagedClusterSetSpec = map[string]string{ - "": "ManagedClusterSetSpec describes the attributes of the ManagedClusterSet", -} - -func (ManagedClusterSetSpec) SwaggerDoc() map[string]string { - return map_ManagedClusterSetSpec -} - -var map_ManagedClusterSetStatus = map[string]string{ - "": "ManagedClusterSetStatus represents the current status of the ManagedClusterSet.", - "conditions": "Conditions contains the different condition statuses for this ManagedClusterSet.", -} - -func (ManagedClusterSetStatus) SwaggerDoc() map[string]string { - return map_ManagedClusterSetStatus -} - -var map_Placement = map[string]string{ - "": "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace.\n\nHere is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3) ManagedClusterSets are bound to workload namespaces; 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set\n of potential ManagedClusters;\n5) Then Placements subselect from that working set using label/claim selection.\n\nNo ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`.\n\nA slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement.\n\nIf a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly.", - "spec": "Spec defines the attributes of Placement.", - "status": "Status represents the current status of the Placement", -} - -func (Placement) SwaggerDoc() map[string]string { - return map_Placement -} - -var map_PlacementDecision = map[string]string{ - "": "PlacementDecision indicates a decision from a placement PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name} to reference a certain placement.\n\nIf a placement has spec.numberOfClusters specified, the total number of decisions contained in status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total number of decisions should be the number of ManagedClusters which match the placement requirements.\n\nSome of the decisions might be empty when there are no enough ManagedClusters meet the placement requirements.", - "status": "Status represents the current status of the PlacementDecision", -} - -func (PlacementDecision) SwaggerDoc() map[string]string { - return map_PlacementDecision -} - -var map_PlacementDecisionList = map[string]string{ - "": "ClusterDecisionList is a collection of PlacementDecision.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of PlacementDecision.", -} - -func (PlacementDecisionList) SwaggerDoc() map[string]string { - return map_PlacementDecisionList -} - -var map_PlacementDecisionStatus = map[string]string{ - "": "PlacementDecisionStatus represents the current status of the PlacementDecision.", - "decisions": "Decisions is a slice of decisions according to a placement The number of decisions should not be larger than 100", -} - -func (PlacementDecisionStatus) SwaggerDoc() map[string]string { - return map_PlacementDecisionStatus -} - -var map_PlacementList = map[string]string{ - "": "PlacementList is a collection of Placements.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of Placements.", -} - -func (PlacementList) SwaggerDoc() map[string]string { - return map_PlacementList -} - -var map_PlacementSpec = map[string]string{ - "": "PlacementSpec defines the attributes of Placement. An empty PlacementSpec selects all ManagedClusters from the ManagedClusterSets bound to the placement namespace. The containing fields are ANDed.", - "clusterSets": "ClusterSets represent the ManagedClusterSets from which the ManagedClusters are selected. If the slice is empty, ManagedClusters will be selected from the ManagedClusterSets bound to the placement namespace, otherwise ManagedClusters will be selected from the intersection of this slice and the ManagedClusterSets bound to the placement namespace.", - "numberOfClusters": "NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the placement requirements. 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets,\n and Predicates) will be selected;\n2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than\n NumberOfClusters, a random subset with desired number of ManagedClusters will be selected;\n3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters,\n all of them will be selected;\n4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters,\n all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be\n set to false;", - "predicates": "Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed.", - "prioritizerPolicy": "PrioritizerPolicy defines the policy of the prioritizers. If this field is unset, then default prioritizer mode and configurations are used. Referring to PrioritizerPolicy to see more description about Mode and Configurations.", - "tolerations": "Tolerations are applied to placements, and allow (but do not require) the managed clusters with certain taints to be selected by placements with matching tolerations.", -} - -func (PlacementSpec) SwaggerDoc() map[string]string { - return map_PlacementSpec -} - -var map_PlacementStatus = map[string]string{ - "numberOfSelectedClusters": "NumberOfSelectedClusters represents the number of selected ManagedClusters", - "conditions": "Conditions contains the different condition status for this Placement.", -} - -func (PlacementStatus) SwaggerDoc() map[string]string { - return map_PlacementStatus -} - -var map_PrioritizerConfig = map[string]string{ - "": "PrioritizerConfig represents the configuration of prioritizer", - "name": "Name will be removed in v1beta1 and replaced by ScoreCoordinate.BuiltIn. If both Name and ScoreCoordinate.BuiltIn are defined, will use the value in ScoreCoordinate.BuiltIn. Name is the name of a prioritizer. Below are the valid names: 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.", - "scoreCoordinate": "ScoreCoordinate represents the configuration of the prioritizer and score source.", - "weight": "Weight defines the weight of the prioritizer score. The value must be ranged in [-10,10]. Each prioritizer will calculate an integer score of a cluster in the range of [-100, 100]. The final score of a cluster will be sum(weight * prioritizer_score). A higher weight indicates that the prioritizer weights more in the cluster selection, while 0 weight indicates that the prioritizer is disabled. A negative weight indicates wants to select the last ones.", -} - -func (PrioritizerConfig) SwaggerDoc() map[string]string { - return map_PrioritizerConfig -} - -var map_PrioritizerPolicy = map[string]string{ - "": "PrioritizerPolicy represents the policy of prioritizer", - "mode": "Mode is either Exact, Additive, \"\" where \"\" is Additive by default. In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations, in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0. Additive doesn't require configuring all prioritizers. The default Configurations may change in the future, and additional prioritization will happen. In Exact mode, any prioritizer not explicitly enumerated is weighted as zero. Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases.", -} - -func (PrioritizerPolicy) SwaggerDoc() map[string]string { - return map_PrioritizerPolicy -} - -var map_ScoreCoordinate = map[string]string{ - "": "ScoreCoordinate represents the configuration of the score type and score source", - "type": "Type defines the type of the prioritizer score. Type is either \"BuiltIn\", \"AddOn\" or \"\", where \"\" is \"BuiltIn\" by default. When the type is \"BuiltIn\", need to specify a BuiltIn prioritizer name in BuiltIn. When the type is \"AddOn\", need to configure the score source in AddOn.", - "builtIn": "BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.", - "addOn": "When type is \"AddOn\", AddOn defines the resource name and score name.", -} - -func (ScoreCoordinate) SwaggerDoc() map[string]string { - return map_ScoreCoordinate -} - -var map_Toleration = map[string]string{ - "": "Toleration represents the toleration object that can be attached to a placement. The placement this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", - "key": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", - "operator": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a placement can tolerate all taints of a particular category.", - "value": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", - "effect": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSelect, PreferNoSelect and NoSelectIfNew.", - "tolerationSeconds": "TolerationSeconds represents the period of time the toleration (which must be of effect NoSelect/PreferNoSelect, otherwise this field is ignored) tolerates the taint. The default value is nil, which indicates it tolerates the taint forever. The start time of counting the TolerationSeconds should be the TimeAdded in Taint, not the cluster scheduled time or TolerationSeconds added time.", -} - -func (Toleration) SwaggerDoc() map[string]string { - return map_Toleration -} - var map_AddOnPlacementScore = map[string]string{ "": "AddOnPlacementScore represents a bundle of scores of one managed cluster, which could be used by placement. AddOnPlacementScore is a namespace scoped resource. The namespace of the resource is the cluster namespace.", "status": "Status represents the status of the AddOnPlacementScore.", diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml index a898cc89c..134e26a69 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml @@ -15,77 +15,6 @@ spec: scope: Cluster preserveUnknownFields: false versions: - - name: v1alpha1 - deprecated: true - deprecationWarning: "cluster.open-cluster-management.io/v1alpha1 ManagedClusterSet is deprecated; use cluster.open-cluster-management.io/v1beta1 ManagedClusterSet" - schema: - openAPIV3Schema: - description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ManagedClusterSet - type: object - status: - description: Status represents the current status of the ManagedClusterSet - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSet. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: false - subresources: - status: {} - additionalPrinterColumns: - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status name: Empty @@ -96,7 +25,7 @@ spec: name: v1beta1 schema: openAPIV3Schema: - description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." + description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." type: object properties: apiVersion: diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml index 86f1c49dd..7a2fc0eb5 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml @@ -15,32 +15,6 @@ spec: scope: Namespaced preserveUnknownFields: false versions: - - name: v1alpha1 - deprecated: true - deprecationWarning: "cluster.open-cluster-management.io/v1alpha1 ManagedClusterSetBinding is deprecated; use cluster.open-cluster-management.io/v1beta1 ManagedClusterSetBinding" - schema: - openAPIV3Schema: - description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of ManagedClusterSetBinding. - type: object - properties: - clusterSet: - description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. - type: string - minLength: 1 - served: true - storage: false - name: v1beta1 schema: openAPIV3Schema: diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml index 639d34cc5..2342ed799 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml @@ -22,12 +22,10 @@ spec: - jsonPath: .status.numberOfSelectedClusters name: SelectedClusters type: integer - name: v1alpha1 - deprecated: true - deprecationWarning: "cluster.open-cluster-management.io/v1alpha1 Placement is deprecated; use cluster.open-cluster-management.io/v1beta1 Placement" + name: v1beta1 schema: openAPIV3Schema: - description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n Here is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3) ManagedClusterSets are bound to workload namespaces; 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters; 5) Then Placements subselect from that working set using label/claim selection. \n No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. \n A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement. \n If a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly." + description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n Here is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2. ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3. ManagedClusterSets are bound to workload namespaces; 4. Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters; 5. Then Placements subselect from that working set using label/claim selection. \n No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. \n A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement. \n If a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly." type: object required: - spec @@ -128,10 +126,9 @@ spec: items: description: PrioritizerConfig represents the configuration of prioritizer type: object + required: + - scoreCoordinate properties: - name: - description: 'Name will be removed in v1beta1 and replaced by ScoreCoordinate.BuiltIn. If both Name and ScoreCoordinate.BuiltIn are defined, will use the value in ScoreCoordinate.BuiltIn. Name is the name of a prioritizer. Below are the valid names: 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.' - type: string scoreCoordinate: description: ScoreCoordinate represents the configuration of the prioritizer and score source. type: object @@ -152,7 +149,7 @@ spec: description: ScoreName defines the score name inside AddOnPlacementScore. AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by the prioritizer. type: string builtIn: - description: 'BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.' + description: 'BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable. 4) Spread: spread the workload evenly to topologies.' type: string type: description: Type defines the type of the prioritizer score. Type is either "BuiltIn", "AddOn" or "", where "" is "BuiltIn" by default. When the type is "BuiltIn", need to specify a BuiltIn prioritizer name in BuiltIn. When the type is "AddOn", need to configure the score source in AddOn. @@ -172,250 +169,45 @@ spec: description: Mode is either Exact, Additive, "" where "" is Additive by default. In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations, in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0. Additive doesn't require configuring all prioritizers. The default Configurations may change in the future, and additional prioritization will happen. In Exact mode, any prioritizer not explicitly enumerated is weighted as zero. Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases. type: string default: Additive - tolerations: - description: Tolerations are applied to placements, and allow (but do not require) the managed clusters with certain taints to be selected by placements with matching tolerations. - type: array - items: - description: Toleration represents the toleration object that can be attached to a placement. The placement this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSelect, PreferNoSelect and NoSelectIfNew. - type: string - enum: - - NoSelect - - PreferNoSelect - - NoSelectIfNew - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a placement can tolerate all taints of a particular category. - type: string - default: Equal - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoSelect/PreferNoSelect, otherwise this field is ignored) tolerates the taint. The default value is nil, which indicates it tolerates the taint forever. The start time of counting the TolerationSeconds should be the TimeAdded in Taint, not the cluster scheduled time or TolerationSeconds added time. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - maxLength: 1024 - status: - description: Status represents the current status of the Placement - type: object - properties: - conditions: - description: Conditions contains the different condition status for this Placement. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - numberOfSelectedClusters: - description: NumberOfSelectedClusters represents the number of selected ManagedClusters - type: integer - format: int32 - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].status - name: Succeeded - type: string - - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].reason - name: Reason - type: string - - jsonPath: .status.numberOfSelectedClusters - name: SelectedClusters - type: integer - name: v1beta1 - schema: - openAPIV3Schema: - description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n Here is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3) ManagedClusterSets are bound to workload namespaces; 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters; 5) Then Placements subselect from that working set using label/claim selection. \n No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. \n A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement. \n If a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly." - type: object - required: - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of Placement. - type: object - properties: - clusterSets: - description: ClusterSets represent the ManagedClusterSets from which the ManagedClusters are selected. If the slice is empty, ManagedClusters will be selected from the ManagedClusterSets bound to the placement namespace, otherwise ManagedClusters will be selected from the intersection of this slice and the ManagedClusterSets bound to the placement namespace. - type: array - items: - type: string - numberOfClusters: - description: NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the placement requirements. 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets, and Predicates) will be selected; 2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than NumberOfClusters, a random subset with desired number of ManagedClusters will be selected; 3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters, all of them will be selected; 4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters, all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be set to false; - type: integer - format: int32 - predicates: - description: Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed. - type: array - items: - description: ClusterPredicate represents a predicate to select ManagedClusters. - type: object - properties: - requiredClusterSelector: - description: RequiredClusterSelector represents a selector of ManagedClusters by label and claim. If specified, 1) Any ManagedCluster, which does not match the selector, should not be selected by this ClusterPredicate; 2) If a selected ManagedCluster (of this ClusterPredicate) ceases to match the selector (e.g. due to an update) of any ClusterPredicate, it will be eventually removed from the placement decisions; 3) If a ManagedCluster (not selected previously) starts to match the selector, it will either be selected or at least has a chance to be selected (when NumberOfClusters is specified); - type: object - properties: - claimSelector: - description: ClaimSelector represents a selector of ManagedClusters by clusterClaims in status - type: object - properties: - matchExpressions: - description: matchExpressions is a list of cluster claim selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - labelSelector: - description: LabelSelector represents a selector of ManagedClusters by label - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - prioritizerPolicy: - description: PrioritizerPolicy defines the policy of the prioritizers. If this field is unset, then default prioritizer mode and configurations are used. Referring to PrioritizerPolicy to see more description about Mode and Configurations. + spreadPolicy: + description: SpreadPolicy defines how placement decisions should be distributed among a set of ManagedClusters. type: object properties: - configurations: + spreadConstraints: + description: SpreadConstraints defines how the placement decision should be distributed among a set of ManagedClusters. The importance of the SpreadConstraintsTerms follows the natural order of their index in the slice. The scheduler first consider SpreadConstraintsTerms with smaller index then those with larger index to distribute the placement decision. type: array + maxItems: 8 items: - description: PrioritizerConfig represents the configuration of prioritizer + description: SpreadConstraintsTerm defines a terminology to spread placement decisions. type: object required: - - scoreCoordinate + - topologyKey + - topologyKeyType properties: - scoreCoordinate: - description: ScoreCoordinate represents the configuration of the prioritizer and score source. - type: object - required: - - type - properties: - addOn: - description: When type is "AddOn", AddOn defines the resource name and score name. - type: object - required: - - resourceName - - scoreName - properties: - resourceName: - description: ResourceName defines the resource name of the AddOnPlacementScore. The placement prioritizer selects AddOnPlacementScore CR by this name. - type: string - scoreName: - description: ScoreName defines the score name inside AddOnPlacementScore. AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by the prioritizer. - type: string - builtIn: - description: 'BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.' - type: string - type: - description: Type defines the type of the prioritizer score. Type is either "BuiltIn", "AddOn" or "", where "" is "BuiltIn" by default. When the type is "BuiltIn", need to specify a BuiltIn prioritizer name in BuiltIn. When the type is "AddOn", need to configure the score source in AddOn. - type: string - default: BuiltIn - enum: - - BuiltIn - - AddOn - weight: - description: Weight defines the weight of the prioritizer score. The value must be ranged in [-10,10]. Each prioritizer will calculate an integer score of a cluster in the range of [-100, 100]. The final score of a cluster will be sum(weight * prioritizer_score). A higher weight indicates that the prioritizer weights more in the cluster selection, while 0 weight indicates that the prioritizer is disabled. A negative weight indicates wants to select the last ones. + maxSkew: + description: MaxSkew represents the degree to which the workload may be unevenly distributed. Skew is the maximum difference between the number of selected ManagedClusters in a topology and the global minimum. The global minimum is the minimum number of selected ManagedClusters for the topologies within the same TopologyKey. The minimum possible value of MaxSkew is 1, and the default value is 1. type: integer format: int32 default: 1 - maximum: 10 - minimum: -10 - mode: - description: Mode is either Exact, Additive, "" where "" is Additive by default. In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations, in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0. Additive doesn't require configuring all prioritizers. The default Configurations may change in the future, and additional prioritization will happen. In Exact mode, any prioritizer not explicitly enumerated is weighted as zero. Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases. - type: string - default: Additive + minimum: 1 + topologyKey: + description: TopologyKey is either a label key or a cluster claim name of ManagedClusters. + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + topologyKeyType: + description: TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim. + type: string + enum: + - Label + - Claim + whenUnsatisfiable: + description: WhenUnsatisfiable represents the action of the scheduler when MaxSkew cannot be satisfied. It could be DoNotSchedule or ScheduleAnyway. The default value is ScheduleAnyway. DoNotSchedule instructs the scheduler not to schedule more ManagedClusters when MaxSkew is not satisfied. ScheduleAnyway instructs the scheduler to keep scheduling even if MaxSkew is not satisfied. + type: string + default: ScheduleAnyway + enum: + - DoNotSchedule + - ScheduleAnyway tolerations: description: Tolerations are applied to placements, and allow (but do not require) the managed clusters with certain taints to be selected by placements with matching tolerations. type: array diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml index e6b8a0024..2a7353118 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml @@ -12,48 +12,6 @@ spec: scope: Namespaced preserveUnknownFields: false versions: - - name: v1alpha1 - deprecated: true - deprecationWarning: "cluster.open-cluster-management.io/v1alpha1 PlacementDecision is deprecated; use cluster.open-cluster-management.io/v1beta1 PlacementDecision" - schema: - openAPIV3Schema: - description: "PlacementDecision indicates a decision from a placement PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name} to reference a certain placement. \n If a placement has spec.numberOfClusters specified, the total number of decisions contained in status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total number of decisions should be the number of ManagedClusters which match the placement requirements. \n Some of the decisions might be empty when there are no enough ManagedClusters meet the placement requirements." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - description: Status represents the current status of the PlacementDecision - type: object - required: - - decisions - properties: - decisions: - description: Decisions is a slice of decisions according to a placement The number of decisions should not be larger than 100 - type: array - items: - description: ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet. - type: object - required: - - clusterName - - reason - properties: - clusterName: - description: ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all placement decisions for the Placement. - type: string - reason: - description: Reason represents the reason why the ManagedCluster is selected. - type: string - served: true - storage: false - subresources: - status: {} - name: v1beta1 schema: openAPIV3Schema: diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_managedclusterset.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/types_managedclusterset.go index 4bdfd4ab5..2bc43f9e0 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_managedclusterset.go +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/types_managedclusterset.go @@ -4,7 +4,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -//LegacyClusterSetLabel LabelKey +// LegacyClusterSetLabel LabelKey const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset" // +genclient @@ -18,9 +18,9 @@ const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset" // ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. // A workload can be defined to deployed on a ManagedClusterSet, which mean: -// 1. The workload can run on any ManagedCluster in the ManagedClusterSet -// 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet -// 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet +// 1. The workload can run on any ManagedCluster in the ManagedClusterSet +// 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet +// 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet // // In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name // `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placement.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placement.go index b5c9c8423..9f4aabd6e 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placement.go +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placement.go @@ -18,12 +18,12 @@ import ( // // Here is how the placement policy combines with other selection methods to determine a matching // list of ManagedClusters: -// 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; -// 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; -// 3) ManagedClusterSets are bound to workload namespaces; -// 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set -// of potential ManagedClusters; -// 5) Then Placements subselect from that working set using label/claim selection. +// 1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; +// 2. ManagedClusters are organized into cluster-scoped ManagedClusterSets; +// 3. ManagedClusterSets are bound to workload namespaces; +// 4. Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set +// of potential ManagedClusters; +// 5. Then Placements subselect from that working set using label/claim selection. // // No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement // namespace. User is able to bind a ManagedClusterSet to a namespace by creating a @@ -85,6 +85,11 @@ type PlacementSpec struct { // +optional PrioritizerPolicy PrioritizerPolicy `json:"prioritizerPolicy"` + // SpreadPolicy defines how placement decisions should be distributed among a + // set of ManagedClusters. + // +optional + SpreadPolicy SpreadPolicy `json:"spreadPolicy,omitempty"` + // Tolerations are applied to placements, and allow (but do not require) the managed clusters with // certain taints to be selected by placements with matching tolerations. // +optional @@ -185,6 +190,7 @@ type ScoreCoordinate struct { // 1) Balance: balance the decisions among the clusters. // 2) Steady: ensure the existing decision is stabilized. // 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable. + // 4) Spread: spread the workload evenly to topologies. // +optional BuiltIn string `json:"builtIn,omitempty"` @@ -215,6 +221,69 @@ type AddOnScore struct { ScoreName string `json:"scoreName"` } +// SpreadPolicy defines how the placement decision should be spread among the ManagedClusters. +type SpreadPolicy struct { + // SpreadConstraints defines how the placement decision should be distributed among a set of ManagedClusters. + // The importance of the SpreadConstraintsTerms follows the natural order of their index in the slice. + // The scheduler first consider SpreadConstraintsTerms with smaller index then those with larger index + // to distribute the placement decision. + // +optional + // +kubebuilder:validation:MaxItems=8 + SpreadConstraints []SpreadConstraintsTerm `json:"spreadConstraints,omitempty"` +} + +// SpreadConstraintsTerm defines a terminology to spread placement decisions. +type SpreadConstraintsTerm struct { + // TopologyKey is either a label key or a cluster claim name of ManagedClusters. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$` + // +kubebuilder:validation:MaxLength=316 + TopologyKey string `json:"topologyKey"` + + // TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=Label;Claim + TopologyKeyType TopologyKeyType `json:"topologyKeyType"` + + // MaxSkew represents the degree to which the workload may be unevenly distributed. + // Skew is the maximum difference between the number of selected ManagedClusters in a topology and the global minimum. + // The global minimum is the minimum number of selected ManagedClusters for the topologies within the same TopologyKey. + // The minimum possible value of MaxSkew is 1, and the default value is 1. + // +optional + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:default=1 + MaxSkew int32 `json:"maxSkew"` + + // WhenUnsatisfiable represents the action of the scheduler when MaxSkew cannot be satisfied. + // It could be DoNotSchedule or ScheduleAnyway. The default value is ScheduleAnyway. + // DoNotSchedule instructs the scheduler not to schedule more ManagedClusters when MaxSkew is not satisfied. + // ScheduleAnyway instructs the scheduler to keep scheduling even if MaxSkew is not satisfied. + // +optional + // +kubebuilder:validation:Enum=DoNotSchedule;ScheduleAnyway + // +kubebuilder:default=ScheduleAnyway + WhenUnsatisfiable UnsatisfiableMaxSkewAction `json:"whenUnsatisfiable"` +} + +// TopologyKeyType represents the type of TopologyKey. +type TopologyKeyType string + +const ( + // Valid TopologyKeyType value is Claim, Label. + TopologyKeyTypeClaim TopologyKeyType = "Claim" + TopologyKeyTypeLabel TopologyKeyType = "Label" +) + +// UnsatisfiableMaxSkewAction represents the action when MaxSkew cannot be satisfied. +type UnsatisfiableMaxSkewAction string + +const ( + // Valid UnsatisfiableMaxSkewAction value is DoNotSchedule, ScheduleAnyway. + DoNotSchedule UnsatisfiableMaxSkewAction = "DoNotSchedule" + ScheduleAnyway UnsatisfiableMaxSkewAction = "ScheduleAnyway" +) + // Toleration represents the toleration object that can be attached to a placement. // The placement this Toleration is attached to tolerates any taint that matches // the triple using the matching operator . @@ -292,3 +361,10 @@ type PlacementList struct { // Items is a list of Placements. Items []Placement `json:"items"` } + +const ( + // PlacementDisableAnnotation is used to disable scheduling for a placement. + // It is a experimental flag to let placement controller ignore this placement, + // so other placement consumers can chime in. + PlacementDisableAnnotation = "cluster.open-cluster-management.io/experimental-scheduling-disable" +) diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placementdecision.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placementdecision.go index 208268432..e9072c8d6 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placementdecision.go +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placementdecision.go @@ -26,7 +26,7 @@ type PlacementDecision struct { Status PlacementDecisionStatus `json:"status,omitempty"` } -//The placementDecsion label name holding the placement name +// The placementDecsion label name holding the placement name const ( PlacementLabel string = "cluster.open-cluster-management.io/placement" ) diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.deepcopy.go index 0b1209d19..f7a6f2f68 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.deepcopy.go +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.deepcopy.go @@ -485,6 +485,7 @@ func (in *PlacementSpec) DeepCopyInto(out *PlacementSpec) { } } in.PrioritizerPolicy.DeepCopyInto(&out.PrioritizerPolicy) + in.SpreadPolicy.DeepCopyInto(&out.SpreadPolicy) if in.Tolerations != nil { in, out := &in.Tolerations, &out.Tolerations *out = make([]Toleration, len(*in)) @@ -593,6 +594,43 @@ func (in *ScoreCoordinate) DeepCopy() *ScoreCoordinate { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpreadConstraintsTerm) DeepCopyInto(out *SpreadConstraintsTerm) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpreadConstraintsTerm. +func (in *SpreadConstraintsTerm) DeepCopy() *SpreadConstraintsTerm { + if in == nil { + return nil + } + out := new(SpreadConstraintsTerm) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpreadPolicy) DeepCopyInto(out *SpreadPolicy) { + *out = *in + if in.SpreadConstraints != nil { + in, out := &in.SpreadConstraints, &out.SpreadConstraints + *out = make([]SpreadConstraintsTerm, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpreadPolicy. +func (in *SpreadPolicy) DeepCopy() *SpreadPolicy { + if in == nil { + return nil + } + out := new(SpreadPolicy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Toleration) DeepCopyInto(out *Toleration) { *out = *in diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.swagger_doc_generated.go index 3b359308f..b8c70231c 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.swagger_doc_generated.go +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.swagger_doc_generated.go @@ -22,7 +22,7 @@ func (ManagedClusterSelector) SwaggerDoc() map[string]string { } var map_ManagedClusterSet = map[string]string{ - "": "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet.", + "": "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet.", "spec": "Spec defines the attributes of the ManagedClusterSet", "status": "Status represents the current status of the ManagedClusterSet", } @@ -136,7 +136,7 @@ func (ClusterSelector) SwaggerDoc() map[string]string { } var map_Placement = map[string]string{ - "": "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace.\n\nHere is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1) Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2) ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3) ManagedClusterSets are bound to workload namespaces; 4) Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set\n of potential ManagedClusters;\n5) Then Placements subselect from that working set using label/claim selection.\n\nNo ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`.\n\nA slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement.\n\nIf a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly.", + "": "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace.\n\nHere is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters:\n 1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters;\n 2. ManagedClusters are organized into cluster-scoped ManagedClusterSets;\n 3. ManagedClusterSets are bound to workload namespaces;\n 4. Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set\n of potential ManagedClusters;\n 5. Then Placements subselect from that working set using label/claim selection.\n\nNo ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`.\n\nA slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement.\n\nIf a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly.", "spec": "Spec defines the attributes of Placement.", "status": "Status represents the current status of the Placement", } @@ -161,6 +161,7 @@ var map_PlacementSpec = map[string]string{ "numberOfClusters": "NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the placement requirements. 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets,\n and Predicates) will be selected;\n2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than\n NumberOfClusters, a random subset with desired number of ManagedClusters will be selected;\n3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters,\n all of them will be selected;\n4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters,\n all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be\n set to false;", "predicates": "Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed.", "prioritizerPolicy": "PrioritizerPolicy defines the policy of the prioritizers. If this field is unset, then default prioritizer mode and configurations are used. Referring to PrioritizerPolicy to see more description about Mode and Configurations.", + "spreadPolicy": "SpreadPolicy defines how placement decisions should be distributed among a set of ManagedClusters.", "tolerations": "Tolerations are applied to placements, and allow (but do not require) the managed clusters with certain taints to be selected by placements with matching tolerations.", } @@ -199,7 +200,7 @@ func (PrioritizerPolicy) SwaggerDoc() map[string]string { var map_ScoreCoordinate = map[string]string{ "": "ScoreCoordinate represents the configuration of the score type and score source", "type": "Type defines the type of the prioritizer score. Type is either \"BuiltIn\", \"AddOn\" or \"\", where \"\" is \"BuiltIn\" by default. When the type is \"BuiltIn\", need to specify a BuiltIn prioritizer name in BuiltIn. When the type is \"AddOn\", need to configure the score source in AddOn.", - "builtIn": "BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.", + "builtIn": "BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable. 4) Spread: spread the workload evenly to topologies.", "addOn": "When type is \"AddOn\", AddOn defines the resource name and score name.", } @@ -207,6 +208,27 @@ func (ScoreCoordinate) SwaggerDoc() map[string]string { return map_ScoreCoordinate } +var map_SpreadConstraintsTerm = map[string]string{ + "": "SpreadConstraintsTerm defines a terminology to spread placement decisions.", + "topologyKey": "TopologyKey is either a label key or a cluster claim name of ManagedClusters.", + "topologyKeyType": "TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim.", + "maxSkew": "MaxSkew represents the degree to which the workload may be unevenly distributed. Skew is the maximum difference between the number of selected ManagedClusters in a topology and the global minimum. The global minimum is the minimum number of selected ManagedClusters for the topologies within the same TopologyKey. The minimum possible value of MaxSkew is 1, and the default value is 1.", + "whenUnsatisfiable": "WhenUnsatisfiable represents the action of the scheduler when MaxSkew cannot be satisfied. It could be DoNotSchedule or ScheduleAnyway. The default value is ScheduleAnyway. DoNotSchedule instructs the scheduler not to schedule more ManagedClusters when MaxSkew is not satisfied. ScheduleAnyway instructs the scheduler to keep scheduling even if MaxSkew is not satisfied.", +} + +func (SpreadConstraintsTerm) SwaggerDoc() map[string]string { + return map_SpreadConstraintsTerm +} + +var map_SpreadPolicy = map[string]string{ + "": "SpreadPolicy defines how the placement decision should be spread among the ManagedClusters.", + "spreadConstraints": "SpreadConstraints defines how the placement decision should be distributed among a set of ManagedClusters. The importance of the SpreadConstraintsTerms follows the natural order of their index in the slice. The scheduler first consider SpreadConstraintsTerms with smaller index then those with larger index to distribute the placement decision.", +} + +func (SpreadPolicy) SwaggerDoc() map[string]string { + return map_SpreadPolicy +} + var map_Toleration = map[string]string{ "": "Toleration represents the toleration object that can be attached to a placement. The placement this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", "key": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml new file mode 100644 index 000000000..3f601df4d --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml @@ -0,0 +1,271 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: managedclustersets.cluster.open-cluster-management.io +spec: + group: cluster.open-cluster-management.io + names: + kind: ManagedClusterSet + listKind: ManagedClusterSetList + plural: managedclustersets + shortNames: + - mclset + - mclsets + singular: managedclusterset + scope: Cluster + preserveUnknownFields: false + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status + name: Empty + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + deprecated: true + deprecationWarning: "cluster.open-cluster-management.io/v1beta1 ManagedClusterSet is deprecated; use cluster.open-cluster-management.io/v1beta2 ManagedClusterSet" + served: true + storage: true + subresources: + status: {} + "schema": + "openAPIV3Schema": + description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of the ManagedClusterSet + type: object + default: + clusterSelector: + selectorType: LegacyClusterSetLabel + properties: + clusterSelector: + description: ClusterSelector represents a selector of ManagedClusters + type: object + default: + selectorType: LegacyClusterSetLabel + properties: + labelSelector: + description: LabelSelector define the general labelSelector which clusterset will use to select target managedClusters + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + selectorType: + description: SelectorType could only be "LegacyClusterSetLabel" or "LabelSelector" "LegacyClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use labelSelector to select target managedClusters + type: string + default: LegacyClusterSetLabel + enum: + - LegacyClusterSetLabel + - LabelSelector + status: + description: Status represents the current status of the ManagedClusterSet + type: object + properties: + conditions: + description: Conditions contains the different condition statuses for this ManagedClusterSet. + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status + name: Empty + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta2 + served: true + storage: false + subresources: + status: {} + "schema": + "openAPIV3Schema": + description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of the ManagedClusterSet + type: object + default: + clusterSelector: + selectorType: ExclusiveClusterSetLabel + properties: + clusterSelector: + description: ClusterSelector represents a selector of ManagedClusters + type: object + default: + selectorType: ExclusiveClusterSetLabel + properties: + labelSelector: + description: LabelSelector define the general labelSelector which clusterset will use to select target managedClusters + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + selectorType: + description: SelectorType could only be "ExclusiveClusterSetLabel" or "LabelSelector" "ExclusiveClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use labelSelector to select target managedClusters + type: string + default: ExclusiveClusterSetLabel + enum: + - ExclusiveClusterSetLabel + - LabelSelector + status: + description: Status represents the current status of the ManagedClusterSet + type: object + properties: + conditions: + description: Conditions contains the different condition statuses for this ManagedClusterSet. + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml new file mode 100644 index 000000000..bf35bb406 --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml @@ -0,0 +1,173 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: managedclustersetbindings.cluster.open-cluster-management.io +spec: + group: cluster.open-cluster-management.io + names: + kind: ManagedClusterSetBinding + listKind: ManagedClusterSetBindingList + plural: managedclustersetbindings + shortNames: + - mclsetbinding + - mclsetbindings + singular: managedclustersetbinding + scope: Namespaced + preserveUnknownFields: false + versions: + - name: v1beta1 + deprecated: true + deprecationWarning: "cluster.open-cluster-management.io/v1beta1 ManagedClusterSetBinding is deprecated; use cluster.open-cluster-management.io/v1beta2 ManagedClusterSetBinding" + schema: + openAPIV3Schema: + description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of ManagedClusterSetBinding. + type: object + properties: + clusterSet: + description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. + type: string + minLength: 1 + status: + description: Status represents the current status of the ManagedClusterSetBinding + type: object + properties: + conditions: + description: Conditions contains the different condition statuses for this ManagedClusterSetBinding. + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + served: true + storage: true + subresources: + status: {} + - name: v1beta2 + schema: + openAPIV3Schema: + description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of ManagedClusterSetBinding. + type: object + properties: + clusterSet: + description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. + type: string + minLength: 1 + status: + description: Status represents the current status of the ManagedClusterSetBinding + type: object + properties: + conditions: + description: Conditions contains the different condition statuses for this ManagedClusterSetBinding. + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + served: true + storage: false + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/doc.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/doc.go new file mode 100644 index 000000000..105f7e834 --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/doc.go @@ -0,0 +1,9 @@ +// Package v1beta2 contains API Schema definitions for the cluster v1beta2 API group +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=open-cluster-management.io/api/cluster +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +kubebuilder:validation:Optional +// +groupName=cluster.open-cluster-management.io +package v1beta2 diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/helpers.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/helpers.go new file mode 100644 index 000000000..25847109d --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/helpers.go @@ -0,0 +1,110 @@ +package v1beta2 + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + v1 "open-cluster-management.io/api/cluster/v1" +) + +type ManagedClustersGetter interface { + List(selector labels.Selector) (ret []*v1.ManagedCluster, err error) +} + +type ManagedClusterSetsGetter interface { + List(selector labels.Selector) (ret []*ManagedClusterSet, err error) +} + +type ManagedClusterSetBindingsGetter interface { + List(namespace string, selector labels.Selector) (ret []*ManagedClusterSetBinding, err error) +} + +// GetClustersFromClusterSet return the ManagedClusterSet's managedClusters +func GetClustersFromClusterSet(clusterSet *ManagedClusterSet, + clustersGetter ManagedClustersGetter) ([]*v1.ManagedCluster, error) { + var clusters []*v1.ManagedCluster + + if clusterSet == nil { + return nil, nil + } + + clusterSelector, err := BuildClusterSelector(clusterSet) + if err != nil { + return nil, err + } + if clusterSelector == nil { + return nil, fmt.Errorf("failed to build ClusterSelector with clusterSet: %v", clusterSet) + } + clusters, err = clustersGetter.List(clusterSelector) + if err != nil { + return nil, fmt.Errorf("failed to list ManagedClusters: %w", err) + } + return clusters, nil +} + +// GetClusterSetsOfClusterByCluster return the managedClusterSets of a managedCluster +func GetClusterSetsOfCluster(cluster *v1.ManagedCluster, + clusterSetsGetter ManagedClusterSetsGetter) ([]*ManagedClusterSet, error) { + var returnClusterSets []*ManagedClusterSet + + if cluster == nil { + return nil, nil + } + + allClusterSets, err := clusterSetsGetter.List(labels.Everything()) + if err != nil { + return nil, err + } + for _, clusterSet := range allClusterSets { + clusterSelector, err := BuildClusterSelector(clusterSet) + if err != nil { + return nil, err + } + if clusterSelector == nil { + return nil, fmt.Errorf("failed to build ClusterSelector with clusterSet: %v", clusterSet) + } + if clusterSelector.Matches(labels.Set(cluster.Labels)) { + returnClusterSets = append(returnClusterSets, clusterSet) + } + } + return returnClusterSets, nil +} + +func BuildClusterSelector(clusterSet *ManagedClusterSet) (labels.Selector, error) { + if clusterSet == nil { + return nil, nil + } + selectorType := clusterSet.Spec.ClusterSelector.SelectorType + + switch selectorType { + case "", ExclusiveClusterSetLabel: + return labels.SelectorFromSet(labels.Set{ + ClusterSetLabel: clusterSet.Name, + }), nil + case LabelSelector: + return metav1.LabelSelectorAsSelector(clusterSet.Spec.ClusterSelector.LabelSelector) + default: + return nil, fmt.Errorf("selectorType is not right: %s", clusterSet.Spec.ClusterSelector.SelectorType) + } +} + +// GetBoundManagedClusterSetBindings returns all bindings that are bounded to clustersets in the given namespace. +func GetBoundManagedClusterSetBindings(namespace string, + clusterSetBindingsGetter ManagedClusterSetBindingsGetter) ([]*ManagedClusterSetBinding, error) { + // get all clusterset bindings under the namespace + bindings, err := clusterSetBindingsGetter.List(namespace, labels.Everything()) + if err != nil { + return nil, err + } + + boundBindings := []*ManagedClusterSetBinding{} + for _, binding := range bindings { + if meta.IsStatusConditionTrue(binding.Status.Conditions, ClusterSetBindingBoundType) { + boundBindings = append(boundBindings, binding) + } + } + + return boundBindings, nil +} diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/register.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/register.go new file mode 100644 index 000000000..ed058a663 --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/register.go @@ -0,0 +1,40 @@ +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "cluster.open-cluster-management.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // Install is a function which adds this version to a scheme + Install = schemeBuilder.AddToScheme + + // SchemeGroupVersion generated code relies on this name + // Deprecated + SchemeGroupVersion = GroupVersion + // AddToScheme exists solely to keep the old generators creating valid code + // DEPRECATED + AddToScheme = schemeBuilder.AddToScheme +) + +// Resource generated code relies on this being here, but it logically belongs to the group +// DEPRECATED +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, + &ManagedClusterSet{}, + &ManagedClusterSetList{}, + &ManagedClusterSetBinding{}, + &ManagedClusterSetBindingList{}, + ) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclusterset.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclusterset.go new file mode 100644 index 000000000..ff43f9b79 --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclusterset.go @@ -0,0 +1,99 @@ +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ExclusiveClusterSetLabel LabelKey +const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope="Cluster",shortName={"mclset","mclsets"} +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Empty",type="string",JSONPath=".status.conditions[?(@.type==\"ClusterSetEmpty\")].status" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" + +// ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. +// A workload can be defined to deployed on a ManagedClusterSet, which mean: +// 1. The workload can run on any ManagedCluster in the ManagedClusterSet +// 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet +// 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet +// +// In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name +// `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. +// User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on +// a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission +// on both the old and new ManagedClusterSet. +type ManagedClusterSet struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the attributes of the ManagedClusterSet + // +kubebuilder:default={clusterSelector: {selectorType: ExclusiveClusterSetLabel}} + Spec ManagedClusterSetSpec `json:"spec"` + + // Status represents the current status of the ManagedClusterSet + // +optional + Status ManagedClusterSetStatus `json:"status,omitempty"` +} + +// ManagedClusterSetSpec describes the attributes of the ManagedClusterSet +type ManagedClusterSetSpec struct { + // ClusterSelector represents a selector of ManagedClusters + // +optional + // +kubebuilder:default:={selectorType: ExclusiveClusterSetLabel} + ClusterSelector ManagedClusterSelector `json:"clusterSelector,omitempty"` +} + +// ManagedClusterSelector represents a selector of ManagedClusters +type ManagedClusterSelector struct { + // SelectorType could only be "ExclusiveClusterSetLabel" or "LabelSelector" + // "ExclusiveClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. + // "LabelSelector" means use labelSelector to select target managedClusters + // +kubebuilder:validation:Enum=ExclusiveClusterSetLabel;LabelSelector + // +kubebuilder:default:=ExclusiveClusterSetLabel + // +required + SelectorType SelectorType `json:"selectorType,omitempty"` + + // LabelSelector define the general labelSelector which clusterset will use to select target managedClusters + // +optional + LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` +} + +type SelectorType string + +const ( + // "ExclusiveClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. + ExclusiveClusterSetLabel SelectorType = "ExclusiveClusterSetLabel" + // "LabelSelector" means use labelSelector to select target managedClusters + LabelSelector SelectorType = "LabelSelector" +) + +// ManagedClusterSetStatus represents the current status of the ManagedClusterSet. +type ManagedClusterSetStatus struct { + // Conditions contains the different condition statuses for this ManagedClusterSet. + Conditions []metav1.Condition `json:"conditions"` +} + +const ( + // ManagedClusterSetConditionEmpty means no ManagedCluster is included in the + // ManagedClusterSet. + ManagedClusterSetConditionEmpty string = "ClusterSetEmpty" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ManagedClusterSetList is a collection of ManagedClusterSet. +type ManagedClusterSetList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + // Items is a list of ManagedClusterSet. + Items []ManagedClusterSet `json:"items"` +} diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclustersetbinding.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclustersetbinding.go new file mode 100644 index 000000000..4871eeb14 --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclustersetbinding.go @@ -0,0 +1,65 @@ +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope="Namespaced",shortName={"mclsetbinding","mclsetbindings"} +// +kubebuilder:storageversion + +// ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. +// User is able to create a ManagedClusterSetBinding in a namespace and bind it to a +// ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of +// managedclustersets/bind. Workloads created in the same namespace can only be +// distributed to ManagedClusters in ManagedClusterSets bound in this namespace by +// higher level controllers. +type ManagedClusterSetBinding struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the attributes of ManagedClusterSetBinding. + Spec ManagedClusterSetBindingSpec `json:"spec"` + + // Status represents the current status of the ManagedClusterSetBinding + // +optional + Status ManagedClusterSetBindingStatus `json:"status,omitempty"` +} + +// ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding. +type ManagedClusterSetBindingSpec struct { + // ClusterSet is the name of the ManagedClusterSet to bind. It must match the + // instance name of the ManagedClusterSetBinding and cannot change once created. + // User is allowed to set this field if they have an RBAC rule to CREATE on the + // virtual subresource of managedclustersets/bind. + // +kubebuilder:validation:MinLength=1 + ClusterSet string `json:"clusterSet"` +} + +const ( + // ClusterSetBindingBoundType is a condition type of clustersetbinding representing + // whether the ClusterSetBinding is bound to a clusterset. + ClusterSetBindingBoundType = "Bound" +) + +// ManagedClusterSetBindingStatus represents the current status of the ManagedClusterSetBinding. +type ManagedClusterSetBindingStatus struct { + // Conditions contains the different condition statuses for this ManagedClusterSetBinding. + Conditions []metav1.Condition `json:"conditions"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding. +type ManagedClusterSetBindingList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + // Items is a list of ManagedClusterSetBinding. + Items []ManagedClusterSetBinding `json:"items"` +} diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 000000000..62bd2dfbe --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,233 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSelector) DeepCopyInto(out *ManagedClusterSelector) { + *out = *in + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSelector. +func (in *ManagedClusterSelector) DeepCopy() *ManagedClusterSelector { + if in == nil { + return nil + } + out := new(ManagedClusterSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSet) DeepCopyInto(out *ManagedClusterSet) { + *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 ManagedClusterSet. +func (in *ManagedClusterSet) DeepCopy() *ManagedClusterSet { + if in == nil { + return nil + } + out := new(ManagedClusterSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManagedClusterSet) 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 *ManagedClusterSetBinding) DeepCopyInto(out *ManagedClusterSetBinding) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBinding. +func (in *ManagedClusterSetBinding) DeepCopy() *ManagedClusterSetBinding { + if in == nil { + return nil + } + out := new(ManagedClusterSetBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManagedClusterSetBinding) 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 *ManagedClusterSetBindingList) DeepCopyInto(out *ManagedClusterSetBindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ManagedClusterSetBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBindingList. +func (in *ManagedClusterSetBindingList) DeepCopy() *ManagedClusterSetBindingList { + if in == nil { + return nil + } + out := new(ManagedClusterSetBindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManagedClusterSetBindingList) 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 *ManagedClusterSetBindingSpec) DeepCopyInto(out *ManagedClusterSetBindingSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBindingSpec. +func (in *ManagedClusterSetBindingSpec) DeepCopy() *ManagedClusterSetBindingSpec { + if in == nil { + return nil + } + out := new(ManagedClusterSetBindingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSetBindingStatus) DeepCopyInto(out *ManagedClusterSetBindingStatus) { + *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 ManagedClusterSetBindingStatus. +func (in *ManagedClusterSetBindingStatus) DeepCopy() *ManagedClusterSetBindingStatus { + if in == nil { + return nil + } + out := new(ManagedClusterSetBindingStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSetList) DeepCopyInto(out *ManagedClusterSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ManagedClusterSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetList. +func (in *ManagedClusterSetList) DeepCopy() *ManagedClusterSetList { + if in == nil { + return nil + } + out := new(ManagedClusterSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManagedClusterSetList) 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 *ManagedClusterSetSpec) DeepCopyInto(out *ManagedClusterSetSpec) { + *out = *in + in.ClusterSelector.DeepCopyInto(&out.ClusterSelector) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetSpec. +func (in *ManagedClusterSetSpec) DeepCopy() *ManagedClusterSetSpec { + if in == nil { + return nil + } + out := new(ManagedClusterSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSetStatus) DeepCopyInto(out *ManagedClusterSetStatus) { + *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 ManagedClusterSetStatus. +func (in *ManagedClusterSetStatus) DeepCopy() *ManagedClusterSetStatus { + if in == nil { + return nil + } + out := new(ManagedClusterSetStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.swagger_doc_generated.go new file mode 100644 index 000000000..33ff38168 --- /dev/null +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.swagger_doc_generated.go @@ -0,0 +1,100 @@ +package v1beta2 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_ManagedClusterSelector = map[string]string{ + "": "ManagedClusterSelector represents a selector of ManagedClusters", + "selectorType": "SelectorType could only be \"ExclusiveClusterSetLabel\" or \"LabelSelector\" \"ExclusiveClusterSetLabel\" means to use label \"cluster.open-cluster-management.io/clusterset:\"\" to select target clusters. \"LabelSelector\" means use labelSelector to select target managedClusters", + "labelSelector": "LabelSelector define the general labelSelector which clusterset will use to select target managedClusters", +} + +func (ManagedClusterSelector) SwaggerDoc() map[string]string { + return map_ManagedClusterSelector +} + +var map_ManagedClusterSet = map[string]string{ + "": "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet.", + "spec": "Spec defines the attributes of the ManagedClusterSet", + "status": "Status represents the current status of the ManagedClusterSet", +} + +func (ManagedClusterSet) SwaggerDoc() map[string]string { + return map_ManagedClusterSet +} + +var map_ManagedClusterSetList = map[string]string{ + "": "ManagedClusterSetList is a collection of ManagedClusterSet.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + "items": "Items is a list of ManagedClusterSet.", +} + +func (ManagedClusterSetList) SwaggerDoc() map[string]string { + return map_ManagedClusterSetList +} + +var map_ManagedClusterSetSpec = map[string]string{ + "": "ManagedClusterSetSpec describes the attributes of the ManagedClusterSet", + "clusterSelector": "ClusterSelector represents a selector of ManagedClusters", +} + +func (ManagedClusterSetSpec) SwaggerDoc() map[string]string { + return map_ManagedClusterSetSpec +} + +var map_ManagedClusterSetStatus = map[string]string{ + "": "ManagedClusterSetStatus represents the current status of the ManagedClusterSet.", + "conditions": "Conditions contains the different condition statuses for this ManagedClusterSet.", +} + +func (ManagedClusterSetStatus) SwaggerDoc() map[string]string { + return map_ManagedClusterSetStatus +} + +var map_ManagedClusterSetBinding = map[string]string{ + "": "ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers.", + "spec": "Spec defines the attributes of ManagedClusterSetBinding.", + "status": "Status represents the current status of the ManagedClusterSetBinding", +} + +func (ManagedClusterSetBinding) SwaggerDoc() map[string]string { + return map_ManagedClusterSetBinding +} + +var map_ManagedClusterSetBindingList = map[string]string{ + "": "ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + "items": "Items is a list of ManagedClusterSetBinding.", +} + +func (ManagedClusterSetBindingList) SwaggerDoc() map[string]string { + return map_ManagedClusterSetBindingList +} + +var map_ManagedClusterSetBindingSpec = map[string]string{ + "": "ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding.", + "clusterSet": "ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind.", +} + +func (ManagedClusterSetBindingSpec) SwaggerDoc() map[string]string { + return map_ManagedClusterSetBindingSpec +} + +var map_ManagedClusterSetBindingStatus = map[string]string{ + "": "ManagedClusterSetBindingStatus represents the current status of the ManagedClusterSetBinding.", + "conditions": "Conditions contains the different condition statuses for this ManagedClusterSetBinding.", +} + +func (ManagedClusterSetBindingStatus) SwaggerDoc() map[string]string { + return map_ManagedClusterSetBindingStatus +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/open-cluster-management.io/api/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/vendor/open-cluster-management.io/api/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml index 0bb82f7e2..395099c03 100644 --- a/vendor/open-cluster-management.io/api/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/vendor/open-cluster-management.io/api/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -131,6 +131,28 @@ spec: registrationImagePullSpec: description: RegistrationImagePullSpec represents the desired image configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified. type: string + workConfiguration: + description: WorkConfiguration contains the configuration of work + type: object + properties: + featureGates: + description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false." + type: array + items: + type: object + required: + - feature + properties: + feature: + description: Feature is the key of feature gate. e.g. featuregate/Foo. + type: string + mode: + description: Mode is either Enable, Disable, "" where "" is Disable by default. In Enable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=true". In Disable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=false". + type: string + default: Disable + enum: + - Enable + - Disable workImagePullSpec: description: WorkImagePullSpec represents the desired image configuration of work agent. quay.io/open-cluster-management.io/work:latest will be used if unspecified. type: string diff --git a/vendor/open-cluster-management.io/api/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml b/vendor/open-cluster-management.io/api/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml index c40c64717..5210faa27 100644 --- a/vendor/open-cluster-management.io/api/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml +++ b/vendor/open-cluster-management.io/api/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml @@ -146,6 +146,28 @@ spec: description: RegistrationImagePullSpec represents the desired image of registration controller/webhook installed on hub. type: string default: quay.io/open-cluster-management/registration + workConfiguration: + description: WorkConfiguration contains the configuration of work + type: object + properties: + featureGates: + description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false." + type: array + items: + type: object + required: + - feature + properties: + feature: + description: Feature is the key of feature gate. e.g. featuregate/Foo. + type: string + mode: + description: Mode is either Enable, Disable, "" where "" is Disable by default. In Enable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=true". In Disable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=false". + type: string + default: Disable + enum: + - Enable + - Disable workImagePullSpec: description: WorkImagePullSpec represents the desired image configuration of work controller/webhook installed on hub. type: string diff --git a/vendor/open-cluster-management.io/api/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/vendor/open-cluster-management.io/api/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml index fdf9a4899..52c509ef5 100644 --- a/vendor/open-cluster-management.io/api/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/vendor/open-cluster-management.io/api/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -131,6 +131,28 @@ spec: registrationImagePullSpec: description: RegistrationImagePullSpec represents the desired image configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified. type: string + workConfiguration: + description: WorkConfiguration contains the configuration of work + type: object + properties: + featureGates: + description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false." + type: array + items: + type: object + required: + - feature + properties: + feature: + description: Feature is the key of feature gate. e.g. featuregate/Foo. + type: string + mode: + description: Mode is either Enable, Disable, "" where "" is Disable by default. In Enable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=true". In Disable mode, a valid feature gate `featuregate/Foo` will be set to "--featuregate/Foo=false". + type: string + default: Disable + enum: + - Enable + - Disable workImagePullSpec: description: WorkImagePullSpec represents the desired image configuration of work agent. quay.io/open-cluster-management.io/work:latest will be used if unspecified. type: string diff --git a/vendor/open-cluster-management.io/api/operator/v1/types.go b/vendor/open-cluster-management.io/api/operator/v1/types.go index 07131426b..4182331d0 100644 --- a/vendor/open-cluster-management.io/api/operator/v1/types.go +++ b/vendor/open-cluster-management.io/api/operator/v1/types.go @@ -57,6 +57,10 @@ type ClusterManagerSpec struct { // RegistrationConfiguration contains the configuration of registration // +optional RegistrationConfiguration *RegistrationConfiguration `json:"registrationConfiguration,omitempty"` + + // WorkConfiguration contains the configuration of work + // +optional + WorkConfiguration *WorkConfiguration `json:"workConfiguration,omitempty"` } type RegistrationConfiguration struct { @@ -71,6 +75,18 @@ type RegistrationConfiguration struct { FeatureGates []FeatureGate `json:"featureGates,omitempty"` } +type WorkConfiguration struct { + // FeatureGates represents the list of feature gates for work + // If it is set empty, default feature gates will be used. + // If it is set, featuregate/Foo is an example of one item in FeatureGates: + // 1. If featuregate/Foo does not exist, registration-operator will discard it + // 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] + // 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, + // he can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false. + // +optional + FeatureGates []FeatureGate `json:"featureGates,omitempty"` +} + type FeatureGate struct { // Feature is the key of feature gate. e.g. featuregate/Foo. // +kubebuilder:validation:Required @@ -163,11 +179,6 @@ const ( // The cluster-manager will be deployed in the hub-cluster, the klusterlet will be deployed in the managed-cluster. InstallModeDefault InstallMode = "Default" - // InstallModeDetached means deploying components outside. - // The cluster-manager will be deployed outside of the hub-cluster, the klusterlet will be deployed outside of the managed-cluster. - // DEPRECATED: please use Hosted instead. - InstallModeDetached InstallMode = "Detached" - // InstallModeHosted means deploying components outside. // The cluster-manager will be deployed outside of the hub-cluster, the klusterlet will be deployed outside of the managed-cluster. InstallModeHosted InstallMode = "Hosted" @@ -330,6 +341,10 @@ type KlusterletSpec struct { // +optional RegistrationConfiguration *RegistrationConfiguration `json:"registrationConfiguration,omitempty"` + // WorkConfiguration contains the configuration of work + // +optional + WorkConfiguration *WorkConfiguration `json:"workConfiguration,omitempty"` + // HubApiServerHostAlias contains the host alias for hub api server. // registration-agent and work-agent will use it to communicate with hub api server. // +optional diff --git a/vendor/open-cluster-management.io/api/operator/v1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/operator/v1/zz_generated.deepcopy.go index 3bfaba4d4..cfd666d22 100644 --- a/vendor/open-cluster-management.io/api/operator/v1/zz_generated.deepcopy.go +++ b/vendor/open-cluster-management.io/api/operator/v1/zz_generated.deepcopy.go @@ -103,6 +103,11 @@ func (in *ClusterManagerSpec) DeepCopyInto(out *ClusterManagerSpec) { *out = new(RegistrationConfiguration) (*in).DeepCopyInto(*out) } + if in.WorkConfiguration != nil { + in, out := &in.WorkConfiguration, &out.WorkConfiguration + *out = new(WorkConfiguration) + (*in).DeepCopyInto(*out) + } return } @@ -309,6 +314,11 @@ func (in *KlusterletSpec) DeepCopyInto(out *KlusterletSpec) { *out = new(RegistrationConfiguration) (*in).DeepCopyInto(*out) } + if in.WorkConfiguration != nil { + in, out := &in.WorkConfiguration, &out.WorkConfiguration + *out = new(WorkConfiguration) + (*in).DeepCopyInto(*out) + } if in.HubApiServerHostAlias != nil { in, out := &in.HubApiServerHostAlias, &out.HubApiServerHostAlias *out = new(HubApiServerHostAlias) @@ -463,3 +473,24 @@ func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkConfiguration) DeepCopyInto(out *WorkConfiguration) { + *out = *in + if in.FeatureGates != nil { + in, out := &in.FeatureGates, &out.FeatureGates + *out = make([]FeatureGate, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkConfiguration. +func (in *WorkConfiguration) DeepCopy() *WorkConfiguration { + if in == nil { + return nil + } + out := new(WorkConfiguration) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/open-cluster-management.io/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/operator/v1/zz_generated.swagger_doc_generated.go index 0beb00c5c..2f6d5271b 100644 --- a/vendor/open-cluster-management.io/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/open-cluster-management.io/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -49,6 +49,7 @@ var map_ClusterManagerSpec = map[string]string{ "nodePlacement": "NodePlacement enables explicit control over the scheduling of the deployed pods.", "deployOption": "DeployOption contains the options of deploying a cluster-manager Default mode is used if DeployOption is not set.", "registrationConfiguration": "RegistrationConfiguration contains the configuration of registration", + "workConfiguration": "WorkConfiguration contains the configuration of work", } func (ClusterManagerSpec) SwaggerDoc() map[string]string { @@ -149,6 +150,7 @@ var map_KlusterletSpec = map[string]string{ "nodePlacement": "NodePlacement enables explicit control over the scheduling of the deployed pods.", "deployOption": "DeployOption contains the options of deploying a klusterlet", "registrationConfiguration": "RegistrationConfiguration contains the configuration of registration", + "workConfiguration": "WorkConfiguration contains the configuration of work", "hubApiServerHostAlias": "HubApiServerHostAlias contains the host alias for hub api server. registration-agent and work-agent will use it to communicate with hub api server.", } @@ -219,4 +221,12 @@ func (WebhookConfiguration) SwaggerDoc() map[string]string { return map_WebhookConfiguration } +var map_WorkConfiguration = map[string]string{ + "featureGates": "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", +} + +func (WorkConfiguration) SwaggerDoc() map[string]string { + return map_WorkConfiguration +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml index 892fd392e..07fe26ee8 100644 --- a/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml @@ -30,6 +30,9 @@ spec: description: Spec represents the desired configuration of AppliedManifestWork. type: object properties: + agentID: + description: AgentID represents the ID of the work agent who is to handle this AppliedManifestWork. + type: string hubHash: description: HubHash represents the hash of the first hub kube apiserver to identify which hub this AppliedManifestWork links to. type: string diff --git a/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml index e75e8c054..981f9147e 100644 --- a/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml @@ -31,6 +31,9 @@ spec: description: Spec represents the desired configuration of AppliedManifestWork. type: object properties: + agentID: + description: AgentID represents the ID of the work agent who is to handle this AppliedManifestWork. + type: string hubHash: description: HubHash represents the hash of the first hub kube apiserver to identify which hub this AppliedManifestWork links to. type: string diff --git a/vendor/open-cluster-management.io/api/work/v1/types.go b/vendor/open-cluster-management.io/api/work/v1/types.go index 2777a157a..efa94f1ca 100644 --- a/vendor/open-cluster-management.io/api/work/v1/types.go +++ b/vendor/open-cluster-management.io/api/work/v1/types.go @@ -527,6 +527,9 @@ type AppliedManifestWorkSpec struct { // +required HubHash string `json:"hubHash"` + // AgentID represents the ID of the work agent who is to handle this AppliedManifestWork. + AgentID string `json:"agentID"` + // ManifestWorkName represents the name of the related manifestwork on the hub. // +required ManifestWorkName string `json:"manifestWorkName"` diff --git a/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go index 24f8a4cbe..838080f7c 100644 --- a/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go @@ -44,6 +44,7 @@ func (AppliedManifestWorkList) SwaggerDoc() map[string]string { var map_AppliedManifestWorkSpec = map[string]string{ "": "AppliedManifestWorkSpec represents the desired configuration of AppliedManifestWork", "hubHash": "HubHash represents the hash of the first hub kube apiserver to identify which hub this AppliedManifestWork links to.", + "agentID": "AgentID represents the ID of the work agent who is to handle this AppliedManifestWork.", "manifestWorkName": "ManifestWorkName represents the name of the related manifestwork on the hub.", } diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_placemanifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_placemanifestworks.crd.yaml new file mode 100644 index 000000000..047cc2154 --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_placemanifestworks.crd.yaml @@ -0,0 +1,310 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: placementmanifestworks.work.open-cluster-management.io +spec: + group: work.open-cluster-management.io + names: + kind: PlaceManifestWork + listKind: PlaceManifestWorkList + plural: placementmanifestworks + shortNames: + - pmw + - pmws + singular: placemanifestwork + scope: Namespaced + preserveUnknownFields: false + versions: + - additionalPrinterColumns: + - description: Reason + jsonPath: .status.conditions[?(@.type=="PlacementVerified")].reason + name: Placement + type: string + - description: Configured + jsonPath: .status.conditions[?(@.type=="PlacementVerified")].status + name: Found + type: string + - description: Reason + jsonPath: .status.conditions[?(@.type=="ManifestworkApplied")].reason + name: ManifestWorks + type: string + - description: Applied + jsonPath: .status.conditions[?(@.type=="ManifestworkApplied")].status + name: Applied + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: PlaceManifestWork is the Schema for the PlaceManifestWorks API. This custom resource is able to apply ManifestWork using Placement for 0..n ManagedCluster(in their namespaces). It will also remove the ManifestWork custom resources when deleted. Lastly the specific ManifestWork custom resources created per ManagedCluster namespace will be adjusted based on PlacementDecision changes. + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec reperesents the desired ManifestWork payload and Placement reference to be reconciled + type: object + properties: + manifestWorkTemplate: + description: ManifestWorkTemplate is the ManifestWorkSpec that will be used to generate a per-cluster ManifestWork + type: object + properties: + deleteOption: + description: DeleteOption represents deletion strategy when the manifestwork is deleted. Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set. + type: object + properties: + propagationPolicy: + description: propagationPolicy can be Foreground, Orphan or SelectivelyOrphan SelectivelyOrphan should be rarely used. It is provided for cases where particular resources is transfering ownership from one ManifestWork to another or another management unit. Setting this value will allow a flow like 1. create manifestwork/2 to manage foo 2. update manifestwork/1 to selectively orphan foo 3. remove foo from manifestwork/1 without impacting continuity because manifestwork/2 adopts it. + type: string + default: Foreground + enum: + - Foreground + - Orphan + - SelectivelyOrphan + selectivelyOrphans: + description: selectivelyOrphan represents a list of resources following orphan deletion stratecy + type: object + properties: + orphaningRules: + description: orphaningRules defines a slice of orphaningrule. Each orphaningrule identifies a single resource included in this manifestwork + type: array + items: + description: OrphaningRule identifies a single resource included in this manifestwork to be orphaned + type: object + required: + - name + - resource + properties: + group: + description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. + type: string + name: + description: Name is the name of the Kubernetes resource. + type: string + namespace: + description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. + type: string + resource: + description: Resource is the resource name of the Kubernetes resource. + type: string + executor: + description: Executor is the configuration that makes the work agent to perform some pre-request processing/checking. e.g. the executor identity tells the work agent to check the executor has sufficient permission to write the workloads to the local managed cluster. Note that nil executor is still supported for backward-compatibility which indicates that the work agent will not perform any additional actions before applying resources. + type: object + properties: + subject: + description: Subject is the subject identity which the work agent uses to talk to the local cluster when applying the resources. + type: object + required: + - type + properties: + serviceAccount: + description: ServiceAccount is for identifying which service account to use by the work agent. Only required if the type is "ServiceAccount". + type: object + required: + - name + - namespace + properties: + name: + description: Name is the name of the service account. + type: string + maxLength: 253 + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ + namespace: + description: Namespace is the namespace of the service account. + type: string + maxLength: 253 + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ + type: + description: 'Type is the type of the subject identity. Supported types are: "ServiceAccount".' + type: string + enum: + - ServiceAccount + manifestConfigs: + description: ManifestConfigs represents the configurations of manifests defined in workload field. + type: array + items: + description: ManifestConfigOption represents the configurations of a manifest defined in workload field. + type: object + required: + - resourceIdentifier + properties: + feedbackRules: + description: FeedbackRules defines what resource status field should be returned. If it is not set or empty, no feedback rules will be honored. + type: array + items: + type: object + required: + - type + properties: + jsonPaths: + description: JsonPaths defines the json path under status field to be synced. + type: array + items: + type: object + required: + - name + - path + properties: + name: + description: Name represents the alias name for this field + type: string + path: + description: Path represents the json path of the field under status. The path must point to a field with single value in the type of integer, bool or string. If the path points to a non-existing field, no value will be returned. If the path points to a structure, map or slice, no value will be returned and the status conddition of StatusFeedBackSynced will be set as false. Ref to https://kubernetes.io/docs/reference/kubectl/jsonpath/ on how to write a jsonPath. + type: string + version: + description: Version is the version of the Kubernetes resource. If it is not specified, the resource with the semantically latest version is used to resolve the path. + type: string + type: + description: Type defines the option of how status can be returned. It can be jsonPaths or wellKnownStatus. If the type is JSONPaths, user should specify the jsonPaths field If the type is WellKnownStatus, certain common fields of status defined by a rule only for types in in k8s.io/api and open-cluster-management/api will be reported, If these status fields do not exist, no values will be reported. + type: string + enum: + - WellKnownStatus + - JSONPaths + resourceIdentifier: + description: ResourceIdentifier represents the group, resource, name and namespace of a resoure. iff this refers to a resource not created by this manifest work, the related rules will not be executed. + type: object + required: + - name + - resource + properties: + group: + description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. + type: string + name: + description: Name is the name of the Kubernetes resource. + type: string + namespace: + description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. + type: string + resource: + description: Resource is the resource name of the Kubernetes resource. + type: string + updateStrategy: + description: UpdateStrategy defines the strategy to update this manifest. UpdateStrategy is Update if it is not set, optional + type: object + required: + - type + properties: + serverSideApply: + description: serverSideApply defines the configuration for server side apply. It is honored only when type of updateStrategy is ServerSideApply + type: object + properties: + fieldManager: + description: FieldManager is the manager to apply the resource. It is work-agent by default, but can be other name with work-agent as the prefix. + type: string + default: work-agent + pattern: ^work-agent + force: + description: Force represents to force apply the manifest. + type: boolean + type: + description: type defines the strategy to update this manifest, default value is Update. Update type means to update resource by an update call. CreateOnly type means do not update resource based on current manifest. ServerSideApply type means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False with the reason of ApplyConflict. + type: string + default: Update + enum: + - Update + - CreateOnly + - ServerSideApply + workload: + description: Workload represents the manifest workload to be deployed on a managed cluster. + type: object + properties: + manifests: + description: Manifests represents a list of kuberenetes resources to be deployed on a managed cluster. + type: array + items: + description: Manifest represents a resource to be deployed on managed cluster. + type: object + x-kubernetes-preserve-unknown-fields: true + x-kubernetes-embedded-resource: true + placementRef: + description: PacementRef is the name of the Placement resource, from which a PlacementDecision will be found and used to distribute the ManifestWork + type: object + properties: + name: + description: Name of the Placement resource in the current namespace + type: string + status: + description: Status represent the current status of Placing ManifestWork resources + type: object + properties: + conditions: + description: 'Conditions contains the different condition statuses for distrbution of ManifestWork resources Valid condition types are: 1. AppliedManifestWorks represents ManifestWorks have been distributed as per placement All, Partial, None, Problem 2. PlacementRefValid' + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + summary: + description: Summary totals of resulting ManifestWorks + type: object + properties: + Applied: + description: 'Applied is the number of ManifestWorks with condition Applied: true' + type: integer + available: + description: 'Available is the number of ManifestWorks with condition Available: true' + type: integer + degraded: + description: 'TODO: Degraded is the number of ManifestWorks with condition Degraded: true' + type: integer + progressing: + description: 'TODO: Progressing is the number of ManifestWorks with condition Progressing: true' + type: integer + total: + description: Total number of ManifestWorks managed by the PlaceManifestWork + type: integer + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/doc.go b/vendor/open-cluster-management.io/api/work/v1alpha1/doc.go new file mode 100644 index 000000000..0980bcb02 --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/doc.go @@ -0,0 +1,9 @@ +// Package v1 contains API Schema definitions for the work v1 API group +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=open-cluster-management.io/api/work +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +kubebuilder:validation:Optional +// +groupName=work.open-cluster-management.io +package v1alpha1 diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/register.go b/vendor/open-cluster-management.io/api/work/v1alpha1/register.go new file mode 100644 index 000000000..1c84d2ef9 --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/register.go @@ -0,0 +1,39 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "work.open-cluster-management.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // Install is a function which adds this version to a scheme + Install = schemeBuilder.AddToScheme + + // SchemeGroupVersion generated code relies on this name + // Deprecated + SchemeGroupVersion = GroupVersion + // AddToScheme exists solely to keep the old generators creating valid code + // DEPRECATED + AddToScheme = schemeBuilder.AddToScheme +) + +// Resource generated code relies on this being here, but it logically belongs to the group +// DEPRECATED +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, + &PlaceManifestWork{}, + &PlaceManifestWorkList{}, + ) + + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/types.go b/vendor/open-cluster-management.io/api/work/v1alpha1/types.go new file mode 100644 index 000000000..555792cdb --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/types.go @@ -0,0 +1,129 @@ +/* +Copyright 2022. + +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 ( + work "open-cluster-management.io/api/work/v1" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=placementmanifestworks,shortName=pmw;pmws,scope=Namespaced +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Placement",type="string",JSONPath=".status.conditions[?(@.type==\"PlacementVerified\")].reason",description="Reason" +// +kubebuilder:printcolumn:name="Found",type="string",JSONPath=".status.conditions[?(@.type==\"PlacementVerified\")].status",description="Configured" +// +kubebuilder:printcolumn:name="ManifestWorks",type="string",JSONPath=".status.conditions[?(@.type==\"ManifestworkApplied\")].reason",description="Reason" +// +kubebuilder:printcolumn:name="Applied",type="string",JSONPath=".status.conditions[?(@.type==\"ManifestworkApplied\")].status",description="Applied" + +// PlaceManifestWork is the Schema for the PlaceManifestWorks API. This custom resource is able to apply +// ManifestWork using Placement for 0..n ManagedCluster(in their namespaces). It will also remove the ManifestWork custom resources +// when deleted. Lastly the specific ManifestWork custom resources created per ManagedCluster namespace will be adjusted based on PlacementDecision +// changes. +type PlaceManifestWork struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec reperesents the desired ManifestWork payload and Placement reference to be reconciled + Spec PlaceManifestWorkSpec `json:"spec,omitempty"` + + // Status represent the current status of Placing ManifestWork resources + Status PlaceManifestWorkStatus `json:"status,omitempty"` +} + +// PlaceManifestWorkSpec defines the desired state of PlaceManifestWork +type PlaceManifestWorkSpec struct { + // ManifestWorkTemplate is the ManifestWorkSpec that will be used to generate a per-cluster ManifestWork + ManifestWorkTemplate work.ManifestWorkSpec `json:"manifestWorkTemplate"` + + // PacementRef is the name of the Placement resource, from which a PlacementDecision will be found and used + // to distribute the ManifestWork + PlacementRef LocalPlacementReference `json:"placementRef,omitempty"` +} + +// PlaceManifestWorkStatus defines the observed state of PlaceManifestWork +type PlaceManifestWorkStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // Conditions contains the different condition statuses for distrbution of ManifestWork resources + // Valid condition types are: + // 1. AppliedManifestWorks represents ManifestWorks have been distributed as per placement All, Partial, None, Problem + // 2. PlacementRefValid + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // Summary totals of resulting ManifestWorks + PlacedManifestWorkSummary PlacedManifestWorkSummary `json:"summary"` +} + +// localPlacementReference is the name of a Placement resource in current namespace +type LocalPlacementReference struct { + // Name of the Placement resource in the current namespace + Name string `json:"name"` +} + +// PlaceManifestWorkSummary provides reference counts of all ManifestWorks that are associated with a +// given PlaceManifestWork resource, for their respective states +type PlacedManifestWorkSummary struct { + // Total number of ManifestWorks managed by the PlaceManifestWork + Total int `json:"total"` + // TODO: Progressing is the number of ManifestWorks with condition Progressing: true + Progressing int `json:"progressing"` + // Available is the number of ManifestWorks with condition Available: true + Available int `json:"available"` + // TODO: Degraded is the number of ManifestWorks with condition Degraded: true + Degraded int `json:"degraded"` + // Applied is the number of ManifestWorks with condition Applied: true + Applied int `json:"Applied"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +// PlaceManifestWorkList contains a list of PlaceManifestWork +type PlaceManifestWorkList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PlaceManifestWork `json:"items"` +} + +type PlaceWorkConditionType string + +const ( + PlacementDecisionNotFound = "PlacementDecisionNotFound" + PlacementDecisionEmpty = "PlacementDecisionEmpty" + + AsExpected = "AsExpected" + Processing = "Processing" + NotAsExpected = "NotAsExpected" + + // PlacementDecisionVerified indicates if Placement is valid + // + // Reason: AsExpected, PlacementDecisionNotFound, PlacementDecisionEmpty or NotAsExpected + PlacementDecisionVerified PlaceWorkConditionType = "PlacementVerified" + + // ManifestWorkApplied confirms that a ManifestWork has been created in each cluster defined by PlacementDecision + // + // Reason: AsExpected, NotAsExpected or Processing + ManifestworkApplied PlaceWorkConditionType = "ManifestworkApplied" +) diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/work/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..d1d6894ef --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,146 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalPlacementReference) DeepCopyInto(out *LocalPlacementReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalPlacementReference. +func (in *LocalPlacementReference) DeepCopy() *LocalPlacementReference { + if in == nil { + return nil + } + out := new(LocalPlacementReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlaceManifestWork) DeepCopyInto(out *PlaceManifestWork) { + *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 PlaceManifestWork. +func (in *PlaceManifestWork) DeepCopy() *PlaceManifestWork { + if in == nil { + return nil + } + out := new(PlaceManifestWork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PlaceManifestWork) 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 *PlaceManifestWorkList) DeepCopyInto(out *PlaceManifestWorkList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PlaceManifestWork, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaceManifestWorkList. +func (in *PlaceManifestWorkList) DeepCopy() *PlaceManifestWorkList { + if in == nil { + return nil + } + out := new(PlaceManifestWorkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PlaceManifestWorkList) 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 *PlaceManifestWorkSpec) DeepCopyInto(out *PlaceManifestWorkSpec) { + *out = *in + in.ManifestWorkTemplate.DeepCopyInto(&out.ManifestWorkTemplate) + out.PlacementRef = in.PlacementRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaceManifestWorkSpec. +func (in *PlaceManifestWorkSpec) DeepCopy() *PlaceManifestWorkSpec { + if in == nil { + return nil + } + out := new(PlaceManifestWorkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlaceManifestWorkStatus) DeepCopyInto(out *PlaceManifestWorkStatus) { + *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]) + } + } + out.PlacedManifestWorkSummary = in.PlacedManifestWorkSummary + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaceManifestWorkStatus. +func (in *PlaceManifestWorkStatus) DeepCopy() *PlaceManifestWorkStatus { + if in == nil { + return nil + } + out := new(PlaceManifestWorkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlacedManifestWorkSummary) DeepCopyInto(out *PlacedManifestWorkSummary) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacedManifestWorkSummary. +func (in *PlacedManifestWorkSummary) DeepCopy() *PlacedManifestWorkSummary { + if in == nil { + return nil + } + out := new(PlacedManifestWorkSummary) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/work/v1alpha1/zz_generated.swagger_doc_generated.go new file mode 100644 index 000000000..b9cb6aa80 --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/zz_generated.swagger_doc_generated.go @@ -0,0 +1,72 @@ +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_LocalPlacementReference = map[string]string{ + "": "localPlacementReference is the name of a Placement resource in current namespace", + "name": "Name of the Placement resource in the current namespace", +} + +func (LocalPlacementReference) SwaggerDoc() map[string]string { + return map_LocalPlacementReference +} + +var map_PlaceManifestWork = map[string]string{ + "": "PlaceManifestWork is the Schema for the PlaceManifestWorks API. This custom resource is able to apply ManifestWork using Placement for 0..n ManagedCluster(in their namespaces). It will also remove the ManifestWork custom resources when deleted. Lastly the specific ManifestWork custom resources created per ManagedCluster namespace will be adjusted based on PlacementDecision changes.", + "spec": "Spec reperesents the desired ManifestWork payload and Placement reference to be reconciled", + "status": "Status represent the current status of Placing ManifestWork resources", +} + +func (PlaceManifestWork) SwaggerDoc() map[string]string { + return map_PlaceManifestWork +} + +var map_PlaceManifestWorkList = map[string]string{ + "": "\n\nPlaceManifestWorkList contains a list of PlaceManifestWork", +} + +func (PlaceManifestWorkList) SwaggerDoc() map[string]string { + return map_PlaceManifestWorkList +} + +var map_PlaceManifestWorkSpec = map[string]string{ + "": "PlaceManifestWorkSpec defines the desired state of PlaceManifestWork", + "manifestWorkTemplate": "ManifestWorkTemplate is the ManifestWorkSpec that will be used to generate a per-cluster ManifestWork", + "placementRef": "PacementRef is the name of the Placement resource, from which a PlacementDecision will be found and used to distribute the ManifestWork", +} + +func (PlaceManifestWorkSpec) SwaggerDoc() map[string]string { + return map_PlaceManifestWorkSpec +} + +var map_PlaceManifestWorkStatus = map[string]string{ + "": "PlaceManifestWorkStatus defines the observed state of PlaceManifestWork", + "conditions": "Conditions contains the different condition statuses for distrbution of ManifestWork resources Valid condition types are: 1. AppliedManifestWorks represents ManifestWorks have been distributed as per placement All, Partial, None, Problem 2. PlacementRefValid", + "summary": "Summary totals of resulting ManifestWorks", +} + +func (PlaceManifestWorkStatus) SwaggerDoc() map[string]string { + return map_PlaceManifestWorkStatus +} + +var map_PlacedManifestWorkSummary = map[string]string{ + "": "PlaceManifestWorkSummary provides reference counts of all ManifestWorks that are associated with a given PlaceManifestWork resource, for their respective states", + "total": "Total number of ManifestWorks managed by the PlaceManifestWork", + "available": "Available is the number of ManifestWorks with condition Available: true", + "Applied": "Applied is the number of ManifestWorks with condition Applied: true", +} + +func (PlacedManifestWorkSummary) SwaggerDoc() map[string]string { + return map_PlacedManifestWorkSummary +} + +// AUTO-GENERATED FUNCTIONS END HERE