diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 08c18c45d9..1206a236de 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -82,17 +82,6 @@ rules: - list - update - watch -- apiGroups: - - cluster.open-cluster-management.io - resources: - - clusterclaims - verbs: - - create - - delete - - get - - list - - update - - watch - apiGroups: - config.openshift.io resources: diff --git a/controllers/storagecluster/clusterclaims.go b/controllers/storagecluster/clusterclaims.go deleted file mode 100644 index 1e43e370ea..0000000000 --- a/controllers/storagecluster/clusterclaims.go +++ /dev/null @@ -1,296 +0,0 @@ -package storagecluster - -import ( - "context" - "fmt" - "strconv" - "strings" - - "github.com/go-logr/logr" - operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" - rookCephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" - corev1 "k8s.io/api/core/v1" - extensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/clientcmd" - clusterclientv1alpha1 "open-cluster-management.io/api/client/cluster/clientset/versioned" - clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -const ( - RookCephMonSecretName = "rook-ceph-mon" - FsidKey = "fsid" - OdfOperatorNamePrefix = "odf-operator" - ClusterClaimCRDName = "clusterclaims.cluster.open-cluster-management.io" -) - -var ( - ClusterClaimGroup = "odf" - OdfVersion = fmt.Sprintf("version.%s.openshift.io", ClusterClaimGroup) - StorageSystemName = fmt.Sprintf("storagesystemname.%s.openshift.io", ClusterClaimGroup) - StorageClusterName = fmt.Sprintf("storageclustername.%s.openshift.io", ClusterClaimGroup) - StorageClusterCount = fmt.Sprintf("count.storageclusters.%s.openshift.io", ClusterClaimGroup) - StorageClusterDROptimized = fmt.Sprintf("droptimized.%s.openshift.io", ClusterClaimGroup) - CephFsid = fmt.Sprintf("cephfsid.%s.openshift.io", ClusterClaimGroup) -) - -type ocsClusterClaim struct{} - -type ClusterClaimCreator struct { - Context context.Context - Logger logr.Logger - Client client.Client - Values map[string]string - StorageCluster *ocsv1.StorageCluster - StorageClusterCount int -} - -func doesClusterClaimCrdExist(ctx context.Context, client client.Client) (bool, error) { - crd := extensionsv1.CustomResourceDefinition{} - err := client.Get(ctx, types.NamespacedName{Name: ClusterClaimCRDName}, &crd) - if err != nil { - if errors.IsNotFound(err) { - return false, nil - } - return false, err - } - - return true, nil -} - -func (obj *ocsClusterClaim) ensureCreated(r *StorageClusterReconciler, instance *ocsv1.StorageCluster) (reconcile.Result, error) { - ctx := context.TODO() - if crdExists, err := doesClusterClaimCrdExist(ctx, r.Client); !crdExists { - if err != nil { - r.Log.Error(err, "An error has occurred while fetching customresourcedefinition", "CustomResourceDefinition", ClusterClaimCRDName) - return reconcile.Result{}, err - } - return reconcile.Result{}, nil - } - - creator := ClusterClaimCreator{ - Logger: r.Log, - Context: ctx, - Client: r.Client, - Values: make(map[string]string), - StorageCluster: instance, - } - - odfVersion, err := creator.getOdfVersion() - if err != nil { - r.Log.Error(err, "failed to get odf version for operator. retrying again") - return reconcile.Result{}, err - } - - storageClusterCount := len(r.clusters.GetStorageClusters()) - - cephFsid, err := creator.getCephFsid() - if err != nil { - r.Log.Error(err, "failed to get ceph fsid from secret. retrying again") - return reconcile.Result{}, err - } - - storageSystemName, err := creator.getStorageSystemName() - if err != nil { - r.Log.Error(err, "failed to get storagesystem name. retrying again") - return reconcile.Result{}, err - } - - var isDROptimized = "false" - // Set isDROptmized to "false" in case of external clusters as we currently don't have to way to determine - // if external cluster OSDs are using bluestore-rdr - if !instance.Spec.ExternalStorage.Enable { - isDROptimized, err = creator.getIsDROptimized() - if err != nil { - r.Log.Error(err, "failed to get cephcluster status. retrying again") - return reconcile.Result{}, err - } - } - - err = creator.setStorageClusterCount(strconv.Itoa(storageClusterCount)). - setStorageSystemName(storageSystemName). - setStorageClusterName(instance.Name). - setOdfVersion(odfVersion). - setCephFsid(cephFsid). - setDROptimized(isDROptimized). - create() - - return reconcile.Result{}, err -} - -func (c *ClusterClaimCreator) create() error { - kubeconfig, err := clientcmd.BuildConfigFromFlags("", "") - if err != nil { - c.Logger.Error(err, "Failed to get kubeconfig for ClusterClaim client.") - return err - } - - client, err := clusterclientv1alpha1.NewForConfig(kubeconfig) - if err != nil { - c.Logger.Error(err, "Failed to create ClusterClaim client.") - return err - } - - for name, value := range c.Values { - cc := &clusterv1alpha1.ClusterClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - Spec: clusterv1alpha1.ClusterClaimSpec{ - Value: value, - }, - } - - existingClaim, err := client.ClusterV1alpha1().ClusterClaims().Get(c.Context, name, metav1.GetOptions{}) - if err != nil { - if !errors.IsNotFound(err) { - c.Logger.Error(err, "failed to get clusterclaim", "ClusterClaim", name) - return err - } - _, err = client.ClusterV1alpha1().ClusterClaims().Create(c.Context, cc, metav1.CreateOptions{}) - if err != nil { - c.Logger.Error(err, "failed to create clusterclaim", "ClusterClaim", name) - return err - } - c.Logger.Info("created clusterclaim", "ClusterClaim", cc.Name) - continue - } - - if equality.Semantic.DeepEqual(existingClaim.Spec, cc.Spec) { - c.Logger.Info("clusterclaim unchanged", "ClusterClaim", name) - continue - } - - existingClaim.Spec = cc.Spec - _, err = client.ClusterV1alpha1().ClusterClaims().Update(c.Context, existingClaim, metav1.UpdateOptions{}) - if err != nil { - c.Logger.Error(err, "failed to update clusterclaim", "ClusterClaim", name) - return err - } - c.Logger.Info("updated clusterclaim", "ClusterClaim", cc.Name) - } - - return nil -} -func (c *ClusterClaimCreator) getOdfVersion() (string, error) { - var csvs operatorsv1alpha1.ClusterServiceVersionList - err := c.Client.List(c.Context, &csvs, &client.ListOptions{Namespace: c.StorageCluster.Namespace}) - if err != nil { - return "", err - } - - for _, csv := range csvs.Items { - if strings.HasPrefix(csv.Name, OdfOperatorNamePrefix) { - return csv.Spec.Version.String(), nil - } - } - - return "", fmt.Errorf("failed to find csv with prefix %q", OdfOperatorNamePrefix) -} - -func (c *ClusterClaimCreator) getCephFsid() (string, error) { - var rookCephMonSecret corev1.Secret - err := c.Client.Get(c.Context, types.NamespacedName{Name: RookCephMonSecretName, Namespace: c.StorageCluster.Namespace}, &rookCephMonSecret) - if err != nil { - return "", err - } - if val, ok := rookCephMonSecret.Data[FsidKey]; ok { - return string(val), nil - } - - return "", fmt.Errorf("failed to fetch ceph fsid from %q secret", RookCephMonSecretName) -} - -func (c *ClusterClaimCreator) getIsDROptimized() (string, error) { - var cephCluster rookCephv1.CephCluster - err := c.Client.Get(c.Context, types.NamespacedName{Name: generateNameForCephClusterFromString(c.StorageCluster.Name), Namespace: c.StorageCluster.Namespace}, &cephCluster) - if err != nil { - return "false", err - } - if cephCluster.Status.CephStorage == nil || cephCluster.Status.CephStorage.OSD.StoreType == nil { - return "false", fmt.Errorf("cephcluster status does not have OSD store information") - } - bluestorerdr, ok := cephCluster.Status.CephStorage.OSD.StoreType["bluestore-rdr"] - if !ok { - return "false", nil - } - total := getOsdCount(c.StorageCluster) - if bluestorerdr < total { - return "false", nil - } - return "true", nil -} - -func (c *ClusterClaimCreator) setStorageClusterCount(count string) *ClusterClaimCreator { - c.Values[StorageClusterCount] = count - return c -} - -func (c *ClusterClaimCreator) setStorageSystemName(name string) *ClusterClaimCreator { - c.Values[StorageSystemName] = fmt.Sprintf("%s/%s", name, c.StorageCluster.GetNamespace()) - return c -} - -func (c *ClusterClaimCreator) setOdfVersion(version string) *ClusterClaimCreator { - c.Values[OdfVersion] = version - return c -} - -func (c *ClusterClaimCreator) setStorageClusterName(name string) *ClusterClaimCreator { - c.Values[StorageClusterName] = fmt.Sprintf("%s/%s", name, c.StorageCluster.GetNamespace()) - return c -} - -func (c *ClusterClaimCreator) setCephFsid(fsid string) *ClusterClaimCreator { - c.Values[CephFsid] = fsid - return c -} - -func (c *ClusterClaimCreator) setDROptimized(optimized string) *ClusterClaimCreator { - c.Values[StorageClusterDROptimized] = optimized - return c -} - -func (c *ClusterClaimCreator) getStorageSystemName() (string, error) { - for _, ref := range c.StorageCluster.OwnerReferences { - if ref.Kind == "StorageSystem" { - return ref.Name, nil - } - } - - return "", fmt.Errorf("failed to find parent StorageSystem's name in StorageCluster %q ownerreferences", c.StorageCluster.Name) -} - -func (obj *ocsClusterClaim) ensureDeleted(r *StorageClusterReconciler, _ *ocsv1.StorageCluster) (reconcile.Result, error) { - r.Log.Info("deleting ClusterClaim resources") - ctx := context.TODO() - if crdExists, err := doesClusterClaimCrdExist(ctx, r.Client); !crdExists { - if err != nil { - return reconcile.Result{}, err - } - return reconcile.Result{}, nil - } - names := []string{OdfVersion, StorageSystemName, StorageClusterName, CephFsid} - for _, name := range names { - cc := clusterv1alpha1.ClusterClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - } - err := r.Client.Delete(context.TODO(), &cc) - if errors.IsNotFound(err) { - continue - } else if err != nil { - r.Log.Error(err, "failed to delete ClusterClaim", "ClusterClaim", cc.Name) - return reconcile.Result{}, fmt.Errorf("failed to delete %v: %v", cc.Name, err) - } - } - - return reconcile.Result{}, nil -} diff --git a/controllers/storagecluster/external_resources_test.go b/controllers/storagecluster/external_resources_test.go index 345a74dcb3..c6bb4fdd0d 100644 --- a/controllers/storagecluster/external_resources_test.go +++ b/controllers/storagecluster/external_resources_test.go @@ -127,7 +127,8 @@ func createExternalClusterReconcilerFromCustomResources( UninstallModeAnnotation: string(UninstallModeGraceful), CleanupPolicyAnnotation: string(CleanupPolicyDelete), }, - Finalizers: []string{storageClusterFinalizer}, + Finalizers: []string{storageClusterFinalizer}, + OwnerReferences: []metav1.OwnerReference{{Name: "storage-test", Kind: "StorageSystem", APIVersion: "v1"}}, }, Spec: api.StorageClusterSpec{ ExternalStorage: api.ExternalStorageClusterSpec{ diff --git a/controllers/storagecluster/initialization_reconciler_test.go b/controllers/storagecluster/initialization_reconciler_test.go index 6583bbbf15..9f00120c78 100644 --- a/controllers/storagecluster/initialization_reconciler_test.go +++ b/controllers/storagecluster/initialization_reconciler_test.go @@ -2,6 +2,11 @@ package storagecluster import ( "context" + "fmt" + "github.com/blang/semver/v4" + oprverion "github.com/operator-framework/api/pkg/lib/version" + opv1a1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + ocsversion "github.com/red-hat-storage/ocs-operator/v4/version" "os" "testing" @@ -39,7 +44,8 @@ func createStorageCluster(scName, failureDomainName string, UninstallModeAnnotation: string(UninstallModeGraceful), CleanupPolicyAnnotation: string(CleanupPolicyDelete), }, - Finalizers: []string{storageClusterFinalizer}, + Finalizers: []string{storageClusterFinalizer}, + OwnerReferences: []metav1.OwnerReference{{Name: "storage-test", Kind: "StorageSystem", APIVersion: "v1"}}, }, Spec: api.StorageClusterSpec{ Monitoring: &api.MonitoringSpec{ @@ -349,6 +355,26 @@ func createFakeInitializationStorageClusterReconciler(t *testing.T, obj ...runti Phase: cephv1.ConditionType(util.PhaseReady), }, } + verOcs, err := semver.Make(getSemVer(ocsversion.Version, 1, true)) + if err != nil { + panic(err) + } + csv := &opv1a1.ClusterServiceVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("ocs-operator-%s", sc.Name), + Namespace: sc.Namespace, + }, + Spec: opv1a1.ClusterServiceVersionSpec{ + Version: oprverion.OperatorVersion{Version: verOcs}, + }, + } + + rookCephMonSecret := &v1.Secret{ + ObjectMeta: metav1.ObjectMeta{Name: "rook-ceph-mon", Namespace: sc.Namespace}, + Data: map[string][]byte{ + "fsid": []byte("b88c2d78-9de9-4227-9313-a63f62f78743"), + }, + } statusSubresourceObjs := []client.Object{sc} var runtimeObjects []runtime.Object @@ -363,7 +389,7 @@ func createFakeInitializationStorageClusterReconciler(t *testing.T, obj ...runti } } - runtimeObjects = append(runtimeObjects, mockNodeList.DeepCopy(), cbp, cfs, cnfs, cnfsbp, cnfssvc, infrastructure, networkConfig) + runtimeObjects = append(runtimeObjects, mockNodeList.DeepCopy(), cbp, cfs, cnfs, cnfsbp, cnfssvc, infrastructure, networkConfig, rookCephMonSecret, csv) client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(runtimeObjects...).WithStatusSubresource(statusSubresourceObjs...).Build() return StorageClusterReconciler{ diff --git a/controllers/storagecluster/odfinfoconfig.go b/controllers/storagecluster/odfinfoconfig.go new file mode 100644 index 0000000000..dc045d2649 --- /dev/null +++ b/controllers/storagecluster/odfinfoconfig.go @@ -0,0 +1,255 @@ +package storagecluster + +import ( + "fmt" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "strings" + "sync" + + operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" + ocsv1a1 "github.com/red-hat-storage/ocs-operator/api/v4/v1alpha1" + "github.com/red-hat-storage/ocs-operator/v4/controllers/util" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/yaml" +) + +type connectedClient struct { + Name string `yaml:"name"` + ClusterID string `yaml:"clusterId"` +} +type infoStorageCluster struct { + NamespacedName types.NamespacedName `yaml:"namespacedName"` + StorageProviderEndpoint string `yaml:"storageProviderEndpoint"` + CephClusterFSID string `yaml:"cephClusterFSID"` +} + +type OdfInfoData struct { + Version string `yaml:"version"` + DeploymentType string `yaml:"deploymentType"` + Clients []connectedClient `yaml:"clients"` + StorageCluster infoStorageCluster `yaml:"storageCluster"` + StorageSystemName string `yaml:"storageSystemName"` +} + +const ( + odfInfoKeySuffix = "config.yaml" + odfDeploymentTypeExternal = "external" + odfDeploymentTypeInternal = "internal" + rookCephMonSecretName = "rook-ceph-mon" + fsidKey = "fsid" + ocsOperatorNamePrefix = "ocs-operator" + odfInfoConfigMapName = "odf-info" + odfInfoMapKind = "ConfigMap" +) + +type odfInfoConfig struct{} + +var _ resourceManager = &odfInfoConfig{} + +var mutex sync.RWMutex + +// ensureCreated ensures that a ConfigMap resource exists with its Spec in +// the desired state. +func (obj *odfInfoConfig) ensureCreated(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCluster) (reconcile.Result, error) { + operatorNamespace, err := util.GetOperatorNamespace() + if err != nil { + return reconcile.Result{}, err + } + + odfInfoConfigMap := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: odfInfoConfigMapName, + Namespace: operatorNamespace, + }, + } + + mutex.Lock() + defer mutex.Unlock() + _, err = ctrl.CreateOrUpdate(r.ctx, r.Client, odfInfoConfigMap, func() error { + // Note: purposely setting OwnerRef instead of ControllerRef, which alongside MatchEveryOwner + // sent in to OwnsOptions in the ConfigMap Owns, guarantees relevant events will be triggered + if err = controllerutil.SetOwnerReference(storageCluster, odfInfoConfigMap, r.Scheme); err != nil { + return err + } + r.Log.Info("Creating or updating odf-info config map", odfInfoMapKind, client.ObjectKeyFromObject(odfInfoConfigMap)) + odfInfoKey := obj.getOdfInfoKeyName(storageCluster) + + odfInfoData, configErr := getOdfInfoData(r, storageCluster) + if configErr != nil { + return fmt.Errorf("failed to get odf-info config map data: %v", configErr) + } + if odfInfoConfigMap.Data == nil { + odfInfoConfigMap.Data = map[string]string{} + } + // Creates or appends to the data map + odfInfoConfigMap.Data[odfInfoKey] = odfInfoData + return nil + }) + if err != nil { + r.Log.Error(err, "failed to create or update odf-info config map", odfInfoMapKind, client.ObjectKeyFromObject(odfInfoConfigMap)) + return reconcile.Result{}, fmt.Errorf("failed to create or update odf-info config: %v", err) + } + return reconcile.Result{}, nil +} + +func (obj *odfInfoConfig) getOdfInfoKeyName(storageCluster *ocsv1.StorageCluster) string { + return fmt.Sprintf("%s_%s.%s", storageCluster.Namespace, storageCluster.Name, odfInfoKeySuffix) +} + +// ensureDeleted is dummy func for the odfInfoConfig +func (obj *odfInfoConfig) ensureDeleted(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCluster) (reconcile.Result, error) { + operatorNamespace, err := util.GetOperatorNamespace() + if err != nil { + return reconcile.Result{}, err + } + odfInfoConfigMap := &corev1.ConfigMap{} + odfInfoConfigMap.Name = odfInfoConfigMapName + odfInfoConfigMap.Namespace = operatorNamespace + if err = r.Client.Get(r.ctx, client.ObjectKeyFromObject(odfInfoConfigMap), odfInfoConfigMap); err != nil { + if errors.IsNotFound(err) { + return reconcile.Result{}, nil + } + return reconcile.Result{}, err + } + + mutex.Lock() + defer mutex.Unlock() + if len(odfInfoConfigMap.Data) > 1 { + odfInfoKeyName := obj.getOdfInfoKeyName(storageCluster) + delete(odfInfoConfigMap.Data, odfInfoKeyName) + if err = r.Client.Update(r.ctx, odfInfoConfigMap); err != nil && !errors.IsNotFound(err) { + r.Log.Error(err, "Failed to update odf-info config map with deleted key.", "ConfigMap", client.ObjectKeyFromObject(odfInfoConfigMap), "Key", odfInfoKeyName) + return reconcile.Result{}, fmt.Errorf("failed to delete key %v in odf-info %v: %v", odfInfoKeyName, odfInfoConfigMap.Name, err) + } + } else { + if err = r.Client.Delete(r.ctx, odfInfoConfigMap); err != nil && !errors.IsNotFound(err) { + r.Log.Error(err, "Failed to delete odf-info config map.", "ConfigMap", client.ObjectKeyFromObject(odfInfoConfigMap)) + return reconcile.Result{}, fmt.Errorf("failed to delete odf-info %v: %v", odfInfoConfigMap.Name, err) + } + } + return reconcile.Result{}, nil +} + +func getOdfInfoData(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCluster) (string, error) { + ocsVersion, err := getOcsVersion(r, storageCluster) + if err != nil { + return "", err + } + cephFSId, err := getCephFsid(r, storageCluster) + if err != nil { + return "", err + } + + odfDeploymentType := odfDeploymentTypeExternal + if !storageCluster.Spec.ExternalStorage.Enable { + odfDeploymentType = odfDeploymentTypeInternal + } + var storageSystemName string + if storageSystemName, err = getStorageSystemName(storageCluster); err != nil { + return "", err + } + + connectedClients, err := getConnectedClients(r, storageCluster) + if err != nil { + return "", err + } + + data := OdfInfoData{ + Version: ocsVersion, + DeploymentType: odfDeploymentType, + StorageSystemName: storageSystemName, + Clients: connectedClients, + StorageCluster: infoStorageCluster{ + NamespacedName: client.ObjectKeyFromObject(storageCluster), + StorageProviderEndpoint: storageCluster.Status.StorageProviderEndpoint, + CephClusterFSID: cephFSId, + }, + } + yamlData, err := yaml.Marshal(data) + if err != nil { + return "", err + } + return string(yamlData), nil + +} + +func getConnectedClients(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCluster) ([]connectedClient, error) { + storageConsumers := &ocsv1a1.StorageConsumerList{} + err := r.Client.List(r.ctx, storageConsumers, client.InNamespace(storageCluster.Namespace)) + if err != nil { + return nil, err + } + connectedClients := make([]connectedClient, 0, len(storageConsumers.Items)) + + for storageConsumerIdx := range storageConsumers.Items { + storageConsumer := &storageConsumers.Items[storageConsumerIdx] + clusterID := storageConsumer.Status.Client.ClusterID + name := storageConsumer.Status.Client.Name + newConnectedClient := connectedClient{ + Name: name, + ClusterID: clusterID, + } + connectedClients = append(connectedClients, newConnectedClient) + } + + return connectedClients, nil +} + +func getStorageSystemName(storageCluster *ocsv1.StorageCluster) (string, error) { + storageSystemRef := util.Find(storageCluster.OwnerReferences, func(ref *metav1.OwnerReference) bool { + return ref.Kind == "StorageSystem" + }) + if storageSystemRef != nil { + return storageSystemRef.Name, nil + } + + return "", fmt.Errorf( + "failed to find parent StorageSystem's name in StorageCluster %q"+ + " ownerreferences, %v", + storageCluster.Name, + storageCluster.OwnerReferences) + +} + +func getOcsVersion(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCluster) (string, error) { + var csvs operatorsv1alpha1.ClusterServiceVersionList + err := r.Client.List(r.ctx, &csvs, client.InNamespace(storageCluster.Namespace)) + if err != nil { + return "", err + } + + csv := util.Find(csvs.Items, func(csv *operatorsv1alpha1.ClusterServiceVersion) bool { + return strings.HasPrefix(csv.Name, ocsOperatorNamePrefix) + }) + if csv == nil { + return "", fmt.Errorf("failed to find csv with prefix %q", ocsOperatorNamePrefix) + } + return csv.Spec.Version.String(), nil +} + +func getCephFsid(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCluster) (string, error) { + rookCephMonSecret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: rookCephMonSecretName, + Namespace: storageCluster.Namespace, + }, + } + + if err := r.Client.Get(r.ctx, client.ObjectKeyFromObject(rookCephMonSecret), rookCephMonSecret); err != nil { + return "", err + } + var val []byte + var ok bool + if val, ok = rookCephMonSecret.Data[fsidKey]; !ok { + return "", fmt.Errorf("failed to fetch ceph fsid from %q secret", rookCephMonSecretName) + } + + return string(val), nil +} diff --git a/controllers/storagecluster/reconcile.go b/controllers/storagecluster/reconcile.go index 8ea6df6fe0..f982328515 100644 --- a/controllers/storagecluster/reconcile.go +++ b/controllers/storagecluster/reconcile.go @@ -124,7 +124,6 @@ var validTopologyLabelKeys = []string{ // +kubebuilder:rbac:groups=operators.coreos.com,resources=operatorconditions,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=quota.openshift.io,resources=clusterresourcequotas,verbs=* // +kubebuilder:rbac:groups=batch,resources=cronjobs;jobs,verbs=get;list;create;update;watch;delete -// +kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=clusterclaims,verbs=get;list;watch;create;update;delete // +kubebuilder:rbac:groups=operators.coreos.com,resources=clusterserviceversions,verbs=get;list;watch // +kubebuilder:rbac:groups=k8s.cni.cncf.io,resources=network-attachment-definitions,verbs=get;list;watch // +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings;rolebindings;clusterroles;roles,verbs=get;list;watch;create;update;patch;delete @@ -407,7 +406,7 @@ func (r *StorageClusterReconciler) reconcilePhases( &ocsSnapshotClass{}, &ocsJobTemplates{}, &ocsCephRbdMirrors{}, - &ocsClusterClaim{}, + &odfInfoConfig{}, } } else { // noobaa-only ensure functions @@ -425,7 +424,7 @@ func (r *StorageClusterReconciler) reconcilePhases( &ocsCephCluster{}, &ocsSnapshotClass{}, &ocsNoobaaSystem{}, - &ocsClusterClaim{}, + &odfInfoConfig{}, } } diff --git a/controllers/storagecluster/storagecluster_controller.go b/controllers/storagecluster/storagecluster_controller.go index 71de729422..52ff29be7f 100644 --- a/controllers/storagecluster/storagecluster_controller.go +++ b/controllers/storagecluster/storagecluster_controller.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os" + "reflect" "github.com/go-logr/logr" nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1" @@ -107,6 +108,17 @@ func (r *StorageClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { }, } + storageConsumerStatusPredicate := predicate.Funcs{ + UpdateFunc: func(e event.UpdateEvent) bool { + if e.ObjectOld == nil || e.ObjectNew == nil { + return false + } + oldObj := e.ObjectOld.(*ocsv1alpha1.StorageConsumer) + newObj := e.ObjectNew.(*ocsv1alpha1.StorageConsumer) + return !reflect.DeepEqual(oldObj.Status.Client, newObj.Status.Client) + }, + } + enqueueStorageClusterRequest := handler.EnqueueRequestsFromMapFunc( func(context context.Context, obj client.Object) []reconcile.Request { // Get the StorageCluster objects @@ -132,24 +144,13 @@ func (r *StorageClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { }, ) - ocsClientOperatorVersionPredicate := predicate.Funcs{ - UpdateFunc: func(e event.UpdateEvent) bool { - if e.ObjectOld == nil || e.ObjectNew == nil { - return false - } - oldObj := e.ObjectOld.(*ocsv1alpha1.StorageConsumer) - newObj := e.ObjectNew.(*ocsv1alpha1.StorageConsumer) - return oldObj.Status.Client.OperatorVersion != newObj.Status.Client.OperatorVersion - }, - } - builder := ctrl.NewControllerManagedBy(mgr). For(&ocsv1.StorageCluster{}, builder.WithPredicates(scPredicate)). Owns(&cephv1.CephCluster{}). Owns(&corev1.PersistentVolumeClaim{}, builder.WithPredicates(pvcPredicate)). Owns(&appsv1.Deployment{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})). Owns(&corev1.Service{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})). - Owns(&corev1.ConfigMap{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})). + Owns(&corev1.ConfigMap{}, builder.MatchEveryOwner, builder.WithPredicates(predicate.GenerationChangedPredicate{})). Owns(&corev1.Secret{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})). Watches(&ocsclientv1a1.StorageClient{}, enqueueStorageClusterRequest). Watches(&ocsv1.StorageProfile{}, enqueueStorageClusterRequest). @@ -161,7 +162,7 @@ func (r *StorageClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { }, enqueueStorageClusterRequest, ). - Watches(&ocsv1alpha1.StorageConsumer{}, enqueueStorageClusterRequest, builder.WithPredicates(ocsClientOperatorVersionPredicate)) + Watches(&ocsv1alpha1.StorageConsumer{}, enqueueStorageClusterRequest, builder.WithPredicates(storageConsumerStatusPredicate)) if os.Getenv("SKIP_NOOBAA_CRD_WATCH") != "true" { builder.Owns(&nbv1.NooBaa{}) } diff --git a/controllers/storagecluster/storagecluster_controller_test.go b/controllers/storagecluster/storagecluster_controller_test.go index 83b7efcb39..0dff9000c7 100644 --- a/controllers/storagecluster/storagecluster_controller_test.go +++ b/controllers/storagecluster/storagecluster_controller_test.go @@ -3,6 +3,9 @@ package storagecluster import ( "context" "fmt" + opverion "github.com/operator-framework/api/pkg/lib/version" + opv1a1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + ocsversion "github.com/red-hat-storage/ocs-operator/v4/version" "net" "os" "regexp" @@ -23,7 +26,6 @@ import ( "github.com/red-hat-storage/ocs-operator/v4/controllers/defaults" "github.com/red-hat-storage/ocs-operator/v4/controllers/platform" statusutil "github.com/red-hat-storage/ocs-operator/v4/controllers/util" - "github.com/red-hat-storage/ocs-operator/v4/version" rookCephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" "github.com/stretchr/testify/assert" appsv1 "k8s.io/api/apps/v1" @@ -66,6 +68,12 @@ var mockStorageCluster = &api.StorageCluster{ CleanupPolicyAnnotation: string(CleanupPolicyDelete), }, Finalizers: []string{storageClusterFinalizer}, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: "v1", + Kind: "StorageSystem", + Name: "storage-test", + }, + }, }, Spec: api.StorageClusterSpec{ Monitoring: &api.MonitoringSpec{ @@ -377,7 +385,7 @@ func TestVersionCheck(t *testing.T) { Namespace: "storage-test-ns", }, }, - expectedVersion: version.Version, + expectedVersion: ocsversion.Version, errorExpected: false, }, { @@ -388,10 +396,10 @@ func TestVersionCheck(t *testing.T) { Namespace: "storage-test-ns", }, Status: api.StorageClusterStatus{ - Version: getSemVer(version.Version, 1, true), + Version: getSemVer(ocsversion.Version, 1, true), }, }, - expectedVersion: version.Version, + expectedVersion: ocsversion.Version, errorExpected: false, }, { @@ -402,10 +410,10 @@ func TestVersionCheck(t *testing.T) { Namespace: "storage-test-ns", }, Status: api.StorageClusterStatus{ - Version: getSemVer(version.Version, 1, false), + Version: getSemVer(ocsversion.Version, 1, false), }, }, - expectedVersion: version.Version, + expectedVersion: ocsversion.Version, errorExpected: true, }, } @@ -818,6 +826,7 @@ func TestNonWatchedReconcileWithNoCephClusterType(t *testing.T) { } func TestNonWatchedReconcileWithTheCephClusterType(t *testing.T) { + testSkipPrometheusRules = true nodeList := &corev1.NodeList{} mockNodeList.DeepCopyInto(nodeList) cc := &rookCephv1.CephCluster{} @@ -855,7 +864,6 @@ func TestStorageDeviceSets(t *testing.T) { "type": "gp2-csi", }, } - reconciler := createFakeStorageClusterReconciler(t, storageClassEBS) testcases := []struct { @@ -1119,7 +1127,26 @@ func createFakeStorageClusterReconciler(t *testing.T, obj ...runtime.Object) Sto Phase: rookCephv1.ConditionType(statusutil.PhaseReady), }, } - obj = append(obj, cbp, cfs) + verOcs, err := semver.Make(getSemVer(ocsversion.Version, 1, true)) + if err != nil { + panic(fmt.Sprintf("failed to parse version: %v", err)) + } + csv := &opv1a1.ClusterServiceVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("ocs-operator-%s", sc.Name), + Namespace: namespace, + }, + Spec: opv1a1.ClusterServiceVersionSpec{ + Version: opverion.OperatorVersion{Version: verOcs}, + }, + } + rookCephMonSecret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{Name: "rook-ceph-mon", Namespace: namespace}, + Data: map[string][]byte{ + "fsid": []byte("b88c2d78-9de9-4227-9313-a63f62f78743"), + }, + } + obj = append(obj, cbp, cfs, rookCephMonSecret, csv) client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(obj...).WithStatusSubresource(sc).Build() clusters, err := statusutil.GetClusters(context.TODO(), client) @@ -1215,6 +1242,11 @@ func createFakeScheme(t *testing.T) *runtime.Scheme { assert.Fail(t, "failed to add ocsclientv1a1 scheme") } + err = opv1a1.AddToScheme(scheme) + if err != nil { + assert.Fail(t, "unable to add opv1a1 to scheme") + } + return scheme } @@ -1273,6 +1305,7 @@ func TestStorageClusterOnMultus(t *testing.T) { }, } } + reconciler := createFakeInitializationStorageClusterReconciler(t) _ = reconciler.Client.Create(context.TODO(), c.cr) result, err := reconciler.Reconcile(context.TODO(), request) diff --git a/controllers/storagecluster/uninstall_reconciler.go b/controllers/storagecluster/uninstall_reconciler.go index c3d8b4c044..ffaecae525 100644 --- a/controllers/storagecluster/uninstall_reconciler.go +++ b/controllers/storagecluster/uninstall_reconciler.go @@ -334,8 +334,8 @@ func (r *StorageClusterReconciler) deleteResources(sc *ocsv1.StorageCluster) (re &ocsStorageQuota{}, &ocsStorageClass{}, &ocsCephCluster{}, - &ocsClusterClaim{}, &backingStorageClasses{}, + &odfInfoConfig{}, } for _, obj := range objs { diff --git a/deploy/csv-templates/ocs-operator.csv.yaml.in b/deploy/csv-templates/ocs-operator.csv.yaml.in index 240725d599..2507aec0c2 100644 --- a/deploy/csv-templates/ocs-operator.csv.yaml.in +++ b/deploy/csv-templates/ocs-operator.csv.yaml.in @@ -235,17 +235,6 @@ spec: - list - update - watch - - apiGroups: - - cluster.open-cluster-management.io - resources: - - clusterclaims - verbs: - - create - - delete - - get - - list - - update - - watch - apiGroups: - config.openshift.io resources: diff --git a/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml b/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml index 342d181d76..2eff050168 100644 --- a/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml +++ b/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml @@ -256,17 +256,6 @@ spec: - list - update - watch - - apiGroups: - - cluster.open-cluster-management.io - resources: - - clusterclaims - verbs: - - create - - delete - - get - - list - - update - - watch - apiGroups: - config.openshift.io resources: diff --git a/go.mod b/go.mod index e3ccea24e6..9253e3259e 100644 --- a/go.mod +++ b/go.mod @@ -45,8 +45,8 @@ require ( k8s.io/client-go v0.29.3 k8s.io/klog/v2 v2.120.1 k8s.io/utils v0.0.0-20240310230437-4693a0247e57 - open-cluster-management.io/api v0.13.0 sigs.k8s.io/controller-runtime v0.17.2 + sigs.k8s.io/yaml v1.4.0 ) require ( @@ -138,7 +138,6 @@ require ( sigs.k8s.io/container-object-storage-interface-api v0.1.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect ) replace github.com/portworx/sched-ops => github.com/portworx/sched-ops v0.20.4-openstorage-rc3 // required by rook diff --git a/go.sum b/go.sum index f100ef8f7d..4c78707f48 100644 --- a/go.sum +++ b/go.sum @@ -1688,8 +1688,6 @@ k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -open-cluster-management.io/api v0.13.0 h1:dlcJEZlNlE0DmSDctK2s7iWKg9l+Tgb0V78Z040nMuk= -open-cluster-management.io/api v0.13.0/go.mod h1:CuCPEzXDvOyxBB0H1d1eSeajbHqaeGEKq9c63vQc63w= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/main.go b/main.go index 5c5ad575c5..9f86717326 100644 --- a/main.go +++ b/main.go @@ -58,7 +58,6 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "k8s.io/client-go/util/retry" - clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" apiclient "sigs.k8s.io/controller-runtime/pkg/client" @@ -90,7 +89,6 @@ func init() { utilruntime.Must(routev1.AddToScheme(scheme)) utilruntime.Must(quotav1.AddToScheme(scheme)) utilruntime.Must(ocsv1alpha1.AddToScheme(scheme)) - utilruntime.Must(clusterv1alpha1.AddToScheme(scheme)) utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme)) utilruntime.Must(nadscheme.AddToScheme(scheme)) utilruntime.Must(ocsclientv1a1.AddToScheme(scheme)) diff --git a/pkg/deploy-manager/config.go b/pkg/deploy-manager/config.go index fc1bda5816..e804dacadb 100644 --- a/pkg/deploy-manager/config.go +++ b/pkg/deploy-manager/config.go @@ -24,6 +24,9 @@ var InstallNamespace string // DefaultStorageClusterName is the name of the storage cluster the test suite installs const DefaultStorageClusterName = "test-storagecluster" +// DefaultStorageClusterStorageSystemName is the name of the storage system owned by default storage cluster +const DefaultStorageClusterStorageSystemName = "test-storage-system" + // DefaultStorageClassRBD is the name of the ceph rbd storage class the test suite installs const DefaultStorageClassRBD = DefaultStorageClusterName + "-ceph-rbd" diff --git a/pkg/deploy-manager/storagecluster.go b/pkg/deploy-manager/storagecluster.go index f922e3485b..758ec689f4 100644 --- a/pkg/deploy-manager/storagecluster.go +++ b/pkg/deploy-manager/storagecluster.go @@ -80,6 +80,14 @@ func (t *DeployManager) DefaultStorageCluster() (*ocsv1.StorageCluster, error) { ObjectMeta: metav1.ObjectMeta{ Name: DefaultStorageClusterName, Namespace: InstallNamespace, + OwnerReferences: []metav1.OwnerReference{ + { + Name: DefaultStorageClusterStorageSystemName, + Kind: "StorageSystem", + APIVersion: "v1", + UID: types.UID(DefaultStorageClusterStorageSystemName), + }, + }, }, Spec: ocsv1.StorageClusterSpec{ ManageNodes: false, diff --git a/vendor/modules.txt b/vendor/modules.txt index 5a60dece36..302459fea7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -937,18 +937,6 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# open-cluster-management.io/api v0.13.0 -## explicit; go 1.21 -open-cluster-management.io/api/client/cluster/clientset/versioned -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/cluster/v1 -open-cluster-management.io/api/cluster/v1alpha1 -open-cluster-management.io/api/cluster/v1beta1 -open-cluster-management.io/api/cluster/v1beta2 # sigs.k8s.io/container-object-storage-interface-api v0.1.0 ## explicit; go 1.18 sigs.k8s.io/container-object-storage-interface-api/apis diff --git a/vendor/open-cluster-management.io/api/LICENSE b/vendor/open-cluster-management.io/api/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/open-cluster-management.io/api/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. 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 deleted file mode 100644 index ef2beaaed7..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - "net/http" - - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - 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 { - Discovery() discovery.DiscoveryInterface - ClusterV1() clusterv1.ClusterV1Interface - ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface - ClusterV1beta1() clusterv1beta1.ClusterV1beta1Interface - ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - clusterV1 *clusterv1.ClusterV1Client - clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client - clusterV1beta1 *clusterv1beta1.ClusterV1beta1Client - clusterV1beta2 *clusterv1beta2.ClusterV1beta2Client -} - -// ClusterV1 retrieves the ClusterV1Client -func (c *Clientset) ClusterV1() clusterv1.ClusterV1Interface { - return c.clusterV1 -} - -// ClusterV1alpha1 retrieves the ClusterV1alpha1Client -func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface { - return c.clusterV1alpha1 -} - -// ClusterV1beta1 retrieves the ClusterV1beta1Client -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 { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.clusterV1, err = clusterv1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - cs.clusterV1alpha1, err = clusterv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - cs.clusterV1beta1, err = clusterv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) - 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 { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.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/doc.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/doc.go deleted file mode 100644 index 14db57a58f..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme 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 deleted file mode 100644 index 57c11727f4..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - 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() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -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" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/cluster_client.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/cluster_client.go deleted file mode 100644 index efe7e4777b..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/cluster_client.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "net/http" - - rest "k8s.io/client-go/rest" - "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" - v1 "open-cluster-management.io/api/cluster/v1" -) - -type ClusterV1Interface interface { - RESTClient() rest.Interface - ManagedClustersGetter -} - -// ClusterV1Client is used to interact with features provided by the cluster.open-cluster-management.io group. -type ClusterV1Client struct { - restClient rest.Interface -} - -func (c *ClusterV1Client) ManagedClusters() ManagedClusterInterface { - return newManagedClusters(c) -} - -// NewForConfig creates a new ClusterV1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ClusterV1Client, 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 ClusterV1Client 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) (*ClusterV1Client, 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 &ClusterV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ClusterV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ClusterV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ClusterV1Client for the given RESTClient. -func New(c rest.Interface) *ClusterV1Client { - return &ClusterV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.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 *ClusterV1Client) 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/v1/doc.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/doc.go deleted file mode 100644 index 225e6b2be3..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/generated_expansion.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/generated_expansion.go deleted file mode 100644 index 4985a7a4d6..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/generated_expansion.go +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type ManagedClusterExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/managedcluster.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/managedcluster.go deleted file mode 100644 index 057100809f..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1/managedcluster.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - metav1 "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" - v1 "open-cluster-management.io/api/cluster/v1" -) - -// ManagedClustersGetter has a method to return a ManagedClusterInterface. -// A group's client should implement this interface. -type ManagedClustersGetter interface { - ManagedClusters() ManagedClusterInterface -} - -// ManagedClusterInterface has methods to work with ManagedCluster resources. -type ManagedClusterInterface interface { - Create(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.CreateOptions) (*v1.ManagedCluster, error) - Update(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (*v1.ManagedCluster, error) - UpdateStatus(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (*v1.ManagedCluster, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ManagedCluster, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ManagedClusterList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManagedCluster, err error) - ManagedClusterExpansion -} - -// managedClusters implements ManagedClusterInterface -type managedClusters struct { - client rest.Interface -} - -// newManagedClusters returns a ManagedClusters -func newManagedClusters(c *ClusterV1Client) *managedClusters { - return &managedClusters{ - client: c.RESTClient(), - } -} - -// Get takes name of the managedCluster, and returns the corresponding managedCluster object, and an error if there is any. -func (c *managedClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ManagedCluster, err error) { - result = &v1.ManagedCluster{} - err = c.client.Get(). - Resource("managedclusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ManagedClusters that match those selectors. -func (c *managedClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ManagedClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ManagedClusterList{} - err = c.client.Get(). - Resource("managedclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested managedClusters. -func (c *managedClusters) Watch(ctx context.Context, opts metav1.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(). - Resource("managedclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a managedCluster and creates it. Returns the server's representation of the managedCluster, and an error, if there is any. -func (c *managedClusters) Create(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.CreateOptions) (result *v1.ManagedCluster, err error) { - result = &v1.ManagedCluster{} - err = c.client.Post(). - Resource("managedclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedCluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a managedCluster and updates it. Returns the server's representation of the managedCluster, and an error, if there is any. -func (c *managedClusters) Update(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (result *v1.ManagedCluster, err error) { - result = &v1.ManagedCluster{} - err = c.client.Put(). - Resource("managedclusters"). - Name(managedCluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedCluster). - 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 *managedClusters) UpdateStatus(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (result *v1.ManagedCluster, err error) { - result = &v1.ManagedCluster{} - err = c.client.Put(). - Resource("managedclusters"). - Name(managedCluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedCluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the managedCluster and deletes it. Returns an error if one occurs. -func (c *managedClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("managedclusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *managedClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("managedclusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched managedCluster. -func (c *managedClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManagedCluster, err error) { - result = &v1.ManagedCluster{} - err = c.client.Patch(pt). - Resource("managedclusters"). - 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/addonplacementscore.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/addonplacementscore.go deleted file mode 100644 index 6cb70c9caf..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/addonplacementscore.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" -) - -// AddOnPlacementScoresGetter has a method to return a AddOnPlacementScoreInterface. -// A group's client should implement this interface. -type AddOnPlacementScoresGetter interface { - AddOnPlacementScores(namespace string) AddOnPlacementScoreInterface -} - -// AddOnPlacementScoreInterface has methods to work with AddOnPlacementScore resources. -type AddOnPlacementScoreInterface interface { - Create(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.CreateOptions) (*v1alpha1.AddOnPlacementScore, error) - Update(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*v1alpha1.AddOnPlacementScore, error) - UpdateStatus(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*v1alpha1.AddOnPlacementScore, 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.AddOnPlacementScore, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AddOnPlacementScoreList, 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.AddOnPlacementScore, err error) - AddOnPlacementScoreExpansion -} - -// addOnPlacementScores implements AddOnPlacementScoreInterface -type addOnPlacementScores struct { - client rest.Interface - ns string -} - -// newAddOnPlacementScores returns a AddOnPlacementScores -func newAddOnPlacementScores(c *ClusterV1alpha1Client, namespace string) *addOnPlacementScores { - return &addOnPlacementScores{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the addOnPlacementScore, and returns the corresponding addOnPlacementScore object, and an error if there is any. -func (c *addOnPlacementScores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnPlacementScore, err error) { - result = &v1alpha1.AddOnPlacementScore{} - err = c.client.Get(). - Namespace(c.ns). - Resource("addonplacementscores"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AddOnPlacementScores that match those selectors. -func (c *addOnPlacementScores) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnPlacementScoreList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.AddOnPlacementScoreList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("addonplacementscores"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested addOnPlacementScores. -func (c *addOnPlacementScores) 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("addonplacementscores"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a addOnPlacementScore and creates it. Returns the server's representation of the addOnPlacementScore, and an error, if there is any. -func (c *addOnPlacementScores) Create(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.CreateOptions) (result *v1alpha1.AddOnPlacementScore, err error) { - result = &v1alpha1.AddOnPlacementScore{} - err = c.client.Post(). - Namespace(c.ns). - Resource("addonplacementscores"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(addOnPlacementScore). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a addOnPlacementScore and updates it. Returns the server's representation of the addOnPlacementScore, and an error, if there is any. -func (c *addOnPlacementScores) Update(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (result *v1alpha1.AddOnPlacementScore, err error) { - result = &v1alpha1.AddOnPlacementScore{} - err = c.client.Put(). - Namespace(c.ns). - Resource("addonplacementscores"). - Name(addOnPlacementScore.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(addOnPlacementScore). - 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 *addOnPlacementScores) UpdateStatus(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (result *v1alpha1.AddOnPlacementScore, err error) { - result = &v1alpha1.AddOnPlacementScore{} - err = c.client.Put(). - Namespace(c.ns). - Resource("addonplacementscores"). - Name(addOnPlacementScore.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(addOnPlacementScore). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the addOnPlacementScore and deletes it. Returns an error if one occurs. -func (c *addOnPlacementScores) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("addonplacementscores"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *addOnPlacementScores) 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("addonplacementscores"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched addOnPlacementScore. -func (c *addOnPlacementScores) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnPlacementScore, err error) { - result = &v1alpha1.AddOnPlacementScore{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("addonplacementscores"). - 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/cluster_client.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go deleted file mode 100644 index e072aa81f9..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go +++ /dev/null @@ -1,96 +0,0 @@ -// 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/cluster/clientset/versioned/scheme" - v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" -) - -type ClusterV1alpha1Interface interface { - RESTClient() rest.Interface - AddOnPlacementScoresGetter - ClusterClaimsGetter -} - -// ClusterV1alpha1Client is used to interact with features provided by the cluster.open-cluster-management.io group. -type ClusterV1alpha1Client struct { - restClient rest.Interface -} - -func (c *ClusterV1alpha1Client) AddOnPlacementScores(namespace string) AddOnPlacementScoreInterface { - return newAddOnPlacementScores(c, namespace) -} - -func (c *ClusterV1alpha1Client) ClusterClaims() ClusterClaimInterface { - return newClusterClaims(c) -} - -// NewForConfig creates a new ClusterV1alpha1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, 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 ClusterV1alpha1Client 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) (*ClusterV1alpha1Client, 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 &ClusterV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new ClusterV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ClusterV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ClusterV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *ClusterV1alpha1Client { - return &ClusterV1alpha1Client{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 *ClusterV1alpha1Client) 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/v1alpha1/clusterclaim.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/clusterclaim.go deleted file mode 100644 index cc28bed024..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/clusterclaim.go +++ /dev/null @@ -1,152 +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" -) - -// ClusterClaimsGetter has a method to return a ClusterClaimInterface. -// A group's client should implement this interface. -type ClusterClaimsGetter interface { - ClusterClaims() ClusterClaimInterface -} - -// ClusterClaimInterface has methods to work with ClusterClaim resources. -type ClusterClaimInterface interface { - Create(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.CreateOptions) (*v1alpha1.ClusterClaim, error) - Update(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.UpdateOptions) (*v1alpha1.ClusterClaim, 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.ClusterClaim, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterClaimList, 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.ClusterClaim, err error) - ClusterClaimExpansion -} - -// clusterClaims implements ClusterClaimInterface -type clusterClaims struct { - client rest.Interface -} - -// newClusterClaims returns a ClusterClaims -func newClusterClaims(c *ClusterV1alpha1Client) *clusterClaims { - return &clusterClaims{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterClaim, and returns the corresponding clusterClaim object, and an error if there is any. -func (c *clusterClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterClaim, err error) { - result = &v1alpha1.ClusterClaim{} - err = c.client.Get(). - Resource("clusterclaims"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterClaims that match those selectors. -func (c *clusterClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterClaimList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterClaimList{} - err = c.client.Get(). - Resource("clusterclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterClaims. -func (c *clusterClaims) 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(). - Resource("clusterclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterClaim and creates it. Returns the server's representation of the clusterClaim, and an error, if there is any. -func (c *clusterClaims) Create(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.CreateOptions) (result *v1alpha1.ClusterClaim, err error) { - result = &v1alpha1.ClusterClaim{} - err = c.client.Post(). - Resource("clusterclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterClaim). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterClaim and updates it. Returns the server's representation of the clusterClaim, and an error, if there is any. -func (c *clusterClaims) Update(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.UpdateOptions) (result *v1alpha1.ClusterClaim, err error) { - result = &v1alpha1.ClusterClaim{} - err = c.client.Put(). - Resource("clusterclaims"). - Name(clusterClaim.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterClaim). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterClaim and deletes it. Returns an error if one occurs. -func (c *clusterClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterclaims"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterClaims) 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(). - Resource("clusterclaims"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterClaim. -func (c *clusterClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterClaim, err error) { - result = &v1alpha1.ClusterClaim{} - err = c.client.Patch(pt). - Resource("clusterclaims"). - 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/doc.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/doc.go deleted file mode 100644 index 93a7ca4e0e..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// 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/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 deleted file mode 100644 index e1db73fc91..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type AddOnPlacementScoreExpansion interface{} - -type ClusterClaimExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/cluster_client.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/cluster_client.go deleted file mode 100644 index 42dae5bddd..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/cluster_client.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "net/http" - - rest "k8s.io/client-go/rest" - "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme" - v1beta1 "open-cluster-management.io/api/cluster/v1beta1" -) - -type ClusterV1beta1Interface interface { - RESTClient() rest.Interface - PlacementsGetter - PlacementDecisionsGetter -} - -// ClusterV1beta1Client is used to interact with features provided by the cluster.open-cluster-management.io group. -type ClusterV1beta1Client struct { - restClient rest.Interface -} - -func (c *ClusterV1beta1Client) Placements(namespace string) PlacementInterface { - return newPlacements(c, namespace) -} - -func (c *ClusterV1beta1Client) PlacementDecisions(namespace string) PlacementDecisionInterface { - return newPlacementDecisions(c, namespace) -} - -// NewForConfig creates a new ClusterV1beta1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ClusterV1beta1Client, 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 ClusterV1beta1Client 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) (*ClusterV1beta1Client, 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 &ClusterV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new ClusterV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ClusterV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ClusterV1beta1Client for the given RESTClient. -func New(c rest.Interface) *ClusterV1beta1Client { - return &ClusterV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.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 *ClusterV1beta1Client) 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/v1beta1/doc.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/doc.go deleted file mode 100644 index 897c0995f8..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/generated_expansion.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/generated_expansion.go deleted file mode 100644 index 701affa7de..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/generated_expansion.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -type PlacementExpansion interface{} - -type PlacementDecisionExpansion interface{} diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/placement.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/placement.go deleted file mode 100644 index 67341e38b0..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/placement.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -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" - v1beta1 "open-cluster-management.io/api/cluster/v1beta1" -) - -// 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 *v1beta1.Placement, opts v1.CreateOptions) (*v1beta1.Placement, error) - Update(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (*v1beta1.Placement, error) - UpdateStatus(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (*v1beta1.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) (*v1beta1.Placement, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.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 *v1beta1.Placement, err error) - PlacementExpansion -} - -// placements implements PlacementInterface -type placements struct { - client rest.Interface - ns string -} - -// newPlacements returns a Placements -func newPlacements(c *ClusterV1beta1Client, 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 *v1beta1.Placement, err error) { - result = &v1beta1.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 *v1beta1.PlacementList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.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 *v1beta1.Placement, opts v1.CreateOptions) (result *v1beta1.Placement, err error) { - result = &v1beta1.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 *v1beta1.Placement, opts v1.UpdateOptions) (result *v1beta1.Placement, err error) { - result = &v1beta1.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 *v1beta1.Placement, opts v1.UpdateOptions) (result *v1beta1.Placement, err error) { - result = &v1beta1.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 *v1beta1.Placement, err error) { - result = &v1beta1.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/v1beta1/placementdecision.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/placementdecision.go deleted file mode 100644 index 0199e573de..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1/placementdecision.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -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" - v1beta1 "open-cluster-management.io/api/cluster/v1beta1" -) - -// 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 *v1beta1.PlacementDecision, opts v1.CreateOptions) (*v1beta1.PlacementDecision, error) - Update(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (*v1beta1.PlacementDecision, error) - UpdateStatus(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (*v1beta1.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) (*v1beta1.PlacementDecision, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.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 *v1beta1.PlacementDecision, err error) - PlacementDecisionExpansion -} - -// placementDecisions implements PlacementDecisionInterface -type placementDecisions struct { - client rest.Interface - ns string -} - -// newPlacementDecisions returns a PlacementDecisions -func newPlacementDecisions(c *ClusterV1beta1Client, 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 *v1beta1.PlacementDecision, err error) { - result = &v1beta1.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 *v1beta1.PlacementDecisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.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 *v1beta1.PlacementDecision, opts v1.CreateOptions) (result *v1beta1.PlacementDecision, err error) { - result = &v1beta1.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 *v1beta1.PlacementDecision, opts v1.UpdateOptions) (result *v1beta1.PlacementDecision, err error) { - result = &v1beta1.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 *v1beta1.PlacementDecision, opts v1.UpdateOptions) (result *v1beta1.PlacementDecision, err error) { - result = &v1beta1.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 *v1beta1.PlacementDecision, err error) { - result = &v1beta1.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 deleted file mode 100644 index e68271b683..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/cluster_client.go +++ /dev/null @@ -1,96 +0,0 @@ -// 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 deleted file mode 100644 index ebe38377f9..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// 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 deleted file mode 100644 index c651d50b1a..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/generated_expansion.go +++ /dev/null @@ -1,7 +0,0 @@ -// 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/v1beta2/managedclusterset.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclusterset.go deleted file mode 100644 index 5ca1be32a3..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclusterset.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1beta2 - -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" - v1beta2 "open-cluster-management.io/api/cluster/v1beta2" -) - -// ManagedClusterSetsGetter has a method to return a ManagedClusterSetInterface. -// A group's client should implement this interface. -type ManagedClusterSetsGetter interface { - ManagedClusterSets() ManagedClusterSetInterface -} - -// ManagedClusterSetInterface has methods to work with ManagedClusterSet resources. -type ManagedClusterSetInterface interface { - 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) (*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 *v1beta2.ManagedClusterSet, err error) - ManagedClusterSetExpansion -} - -// managedClusterSets implements ManagedClusterSetInterface -type managedClusterSets struct { - client rest.Interface -} - -// newManagedClusterSets returns a 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 *v1beta2.ManagedClusterSet, err error) { - result = &v1beta2.ManagedClusterSet{} - err = c.client.Get(). - Resource("managedclustersets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// 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 *v1beta2.ManagedClusterSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.ManagedClusterSetList{} - err = c.client.Get(). - Resource("managedclustersets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested managedClusterSets. -func (c *managedClusterSets) 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(). - Resource("managedclustersets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// 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 *v1beta2.ManagedClusterSet, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSet, err error) { - result = &v1beta2.ManagedClusterSet{} - err = c.client.Post(). - Resource("managedclustersets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedClusterSet). - Do(ctx). - Into(result) - return -} - -// 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 *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSet, err error) { - result = &v1beta2.ManagedClusterSet{} - err = c.client.Put(). - Resource("managedclustersets"). - Name(managedClusterSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedClusterSet). - 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 *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). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedClusterSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the managedClusterSet and deletes it. Returns an error if one occurs. -func (c *managedClusterSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("managedclustersets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *managedClusterSets) 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(). - Resource("managedclustersets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// 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 *v1beta2.ManagedClusterSet, err error) { - result = &v1beta2.ManagedClusterSet{} - err = c.client.Patch(pt). - Resource("managedclustersets"). - 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/managedclustersetbinding.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclustersetbinding.go deleted file mode 100644 index eb24f12504..0000000000 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2/managedclustersetbinding.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1beta2 - -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" - v1beta2 "open-cluster-management.io/api/cluster/v1beta2" -) - -// ManagedClusterSetBindingsGetter has a method to return a ManagedClusterSetBindingInterface. -// A group's client should implement this interface. -type ManagedClusterSetBindingsGetter interface { - ManagedClusterSetBindings(namespace string) ManagedClusterSetBindingInterface -} - -// ManagedClusterSetBindingInterface has methods to work with ManagedClusterSetBinding resources. -type ManagedClusterSetBindingInterface interface { - 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) (*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 *v1beta2.ManagedClusterSetBinding, err error) - ManagedClusterSetBindingExpansion -} - -// managedClusterSetBindings implements ManagedClusterSetBindingInterface -type managedClusterSetBindings struct { - client rest.Interface - ns string -} - -// newManagedClusterSetBindings returns a ManagedClusterSetBindings -func newManagedClusterSetBindings(c *ClusterV1beta2Client, namespace string) *managedClusterSetBindings { - return &managedClusterSetBindings{ - client: c.RESTClient(), - ns: namespace, - } -} - -// 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 *v1beta2.ManagedClusterSetBinding, err error) { - result = &v1beta2.ManagedClusterSetBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("managedclustersetbindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// 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 *v1beta2.ManagedClusterSetBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.ManagedClusterSetBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("managedclustersetbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested managedClusterSetBindings. -func (c *managedClusterSetBindings) 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("managedclustersetbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// 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 *v1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) { - result = &v1beta2.ManagedClusterSetBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("managedclustersetbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedClusterSetBinding). - Do(ctx). - Into(result) - return -} - -// 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 *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). - VersionedParams(&opts, scheme.ParameterCodec). - Body(managedClusterSetBinding). - 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 *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(). - Namespace(c.ns). - Resource("managedclustersetbindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *managedClusterSetBindings) 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("managedclustersetbindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// 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 *v1beta2.ManagedClusterSetBinding, err error) { - result = &v1beta2.ManagedClusterSetBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("managedclustersetbindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml deleted file mode 100644 index 9bd0cb68bc..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml +++ /dev/null @@ -1,287 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: managedclusters.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: ManagedCluster - listKind: ManagedClusterList - plural: managedclusters - shortNames: - - mcl - - mcls - singular: managedcluster - preserveUnknownFields: false - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .spec.hubAcceptsClient - name: Hub Accepted - type: boolean - - jsonPath: .spec.managedClusterClientConfigs[*].url - name: Managed Cluster URLs - type: string - - jsonPath: .status.conditions[?(@.type=="ManagedClusterJoined")].status - name: Joined - type: string - - jsonPath: .status.conditions[?(@.type=="ManagedClusterConditionAvailable")].status - name: Available - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1 - schema: - openAPIV3Schema: - description: "ManagedCluster represents the desired state and current status - of a managed cluster. ManagedCluster is a cluster-scoped resource. The name - is the cluster UID. \n The cluster join process is a double opt-in process. - See the following join process steps: \n 1. The agent on the managed cluster - creates a CSR on the hub with the cluster UID and agent name. 2. The agent - on the managed cluster creates a ManagedCluster on the hub. 3. The cluster - admin on the hub cluster approves the CSR for the UID and agent name of - the ManagedCluster. 4. The cluster admin sets the spec.acceptClient of the - ManagedCluster to true. 5. The cluster admin on the managed cluster creates - a credential of the kubeconfig for the hub cluster. \n After the hub cluster - creates the cluster namespace, the klusterlet agent on the ManagedCluster - pushes the credential to the hub cluster to use against the kube-apiserver - of the ManagedCluster." - 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 the agent on - the managed cluster. - properties: - hubAcceptsClient: - description: hubAcceptsClient represents that hub accepts the joining - of Klusterlet agent on the managed cluster with the hub. The default - value is false, and can only be set true when the user on hub has - an RBAC rule to UPDATE on the virtual subresource of managedclusters/accept. - When the value is set true, a namespace whose name is the same as - the name of ManagedCluster is created on the hub. This namespace - represents the managed cluster, also role/rolebinding is created - on the namespace to grant the permision of access from the agent - on the managed cluster. When the value is set to false, the namespace - representing the managed cluster is deleted. - type: boolean - leaseDurationSeconds: - default: 60 - description: LeaseDurationSeconds is used to coordinate the lease - update time of Klusterlet agents on the managed cluster. If its - value is zero, the Klusterlet agent will update its lease every - 60 seconds by default - format: int32 - type: integer - managedClusterClientConfigs: - description: ManagedClusterClientConfigs represents a list of the - apiserver address of the managed cluster. If it is empty, the managed - cluster has no accessible address for the hub to connect with it. - items: - description: ClientConfig represents the apiserver address of the - managed cluster. TODO include credential to connect to managed - cluster kube-apiserver - properties: - caBundle: - description: CABundle is the ca bundle to connect to apiserver - of the managed cluster. System certs are used if it is not - set. - format: byte - type: string - url: - description: URL is the URL of apiserver endpoint of the managed - cluster. - type: string - type: object - type: array - taints: - description: Taints is a property of managed cluster that allow the - cluster to be repelled when scheduling. Taints, including 'ManagedClusterUnavailable' - and 'ManagedClusterUnreachable', can not be added/removed by agent - running on the managed cluster; while it's fine to add/remove other - taints from either hub cluser or managed cluster. - items: - description: The managed cluster this Taint is attached to has the - "effect" on any placement that does not tolerate the Taint. - properties: - effect: - description: Effect indicates the effect of the taint on placements - that do not tolerate the taint. Valid effects are NoSelect, - PreferNoSelect and NoSelectIfNew. - enum: - - NoSelect - - PreferNoSelect - - NoSelectIfNew - type: string - key: - description: Key is the taint key applied to a cluster. e.g. - bar or foo.example.com/bar. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - timeAdded: - description: TimeAdded represents the time at which the taint - was added. - format: date-time - nullable: true - type: string - value: - description: Value is the taint value corresponding to the taint - key. - maxLength: 1024 - type: string - required: - - effect - - key - type: object - type: array - type: object - status: - description: Status represents the current status of joined managed cluster - properties: - allocatable: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Allocatable represents the total allocatable resources - on the managed cluster. - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Capacity represents the total resource capacity from - all nodeStatuses on the managed cluster. - type: object - clusterClaims: - description: ClusterClaims represents cluster information that a managed - cluster claims, for example a unique cluster identifier (id.k8s.io) - and kubernetes version (kubeversion.open-cluster-management.io). - They are written from the managed cluster. The set of claims is - not uniform across a fleet, some claims can be vendor or version - specific and may not be included from all managed clusters. - items: - description: ManagedClusterClaim represents a ClusterClaim collected - from a managed cluster. - properties: - name: - description: Name is the name of a ClusterClaim resource on - managed cluster. It's a well known or customized name to identify - the claim. - maxLength: 253 - minLength: 1 - type: string - value: - description: Value is a claim-dependent string - maxLength: 1024 - minLength: 1 - type: string - type: object - type: array - conditions: - description: Conditions contains the different condition statuses - for this managed cluster. - 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, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - version: - description: Version represents the kubernetes version of the managed - cluster. - properties: - kubernetes: - description: Kubernetes is the kubernetes version of managed cluster. - type: string - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1/doc.go b/vendor/open-cluster-management.io/api/cluster/v1/doc.go deleted file mode 100644 index d877cde083..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package v1 contains API Schema definitions for the cluster v1 API group -// +k8s:deepcopy-gen=package,register -// +k8s:openapi-gen=true - -// +kubebuilder:validation:Optional -// +groupName=cluster.open-cluster-management.io -package v1 diff --git a/vendor/open-cluster-management.io/api/cluster/v1/register.go b/vendor/open-cluster-management.io/api/cluster/v1/register.go deleted file mode 100644 index 6ac0fdc415..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1/register.go +++ /dev/null @@ -1,38 +0,0 @@ -package v1 - -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: "v1"} - 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, - &ManagedCluster{}, - &ManagedClusterList{}, - ) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/vendor/open-cluster-management.io/api/cluster/v1/types.go b/vendor/open-cluster-management.io/api/cluster/v1/types.go deleted file mode 100644 index 2a65367ae6..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1/types.go +++ /dev/null @@ -1,288 +0,0 @@ -package v1 - -import ( - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope="Cluster",shortName={"mcl","mcls"} -// +kubebuilder:printcolumn:JSONPath=`.spec.hubAcceptsClient`,name="Hub Accepted",type=boolean -// +kubebuilder:printcolumn:JSONPath=`.spec.managedClusterClientConfigs[*].url`,name="Managed Cluster URLs",type=string -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="ManagedClusterJoined")].status`,name="Joined",type=string -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="ManagedClusterConditionAvailable")].status`,name="Available",type=string -// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date - -// ManagedCluster represents the desired state and current status -// of a managed cluster. ManagedCluster is a cluster-scoped resource. The name -// is the cluster UID. -// -// The cluster join process is a double opt-in process. See the following join process steps: -// -// 1. The agent on the managed cluster creates a CSR on the hub with the cluster UID and agent name. -// 2. The agent on the managed cluster creates a ManagedCluster on the hub. -// 3. The cluster admin on the hub cluster approves the CSR for the UID and agent name of the ManagedCluster. -// 4. The cluster admin sets the spec.acceptClient of the ManagedCluster to true. -// 5. The cluster admin on the managed cluster creates a credential of the kubeconfig for the hub cluster. -// -// After the hub cluster creates the cluster namespace, the klusterlet agent on the ManagedCluster pushes -// the credential to the hub cluster to use against the kube-apiserver of the ManagedCluster. -type ManagedCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec represents a desired configuration for the agent on the managed cluster. - Spec ManagedClusterSpec `json:"spec"` - - // Status represents the current status of joined managed cluster - // +optional - Status ManagedClusterStatus `json:"status,omitempty"` -} - -// ManagedClusterSpec provides the information to securely connect to a remote server -// and verify its identity. -type ManagedClusterSpec struct { - // ManagedClusterClientConfigs represents a list of the apiserver address of the managed cluster. - // If it is empty, the managed cluster has no accessible address for the hub to connect with it. - // +optional - ManagedClusterClientConfigs []ClientConfig `json:"managedClusterClientConfigs,omitempty"` - - // hubAcceptsClient represents that hub accepts the joining of Klusterlet agent on - // the managed cluster with the hub. The default value is false, and can only be set - // true when the user on hub has an RBAC rule to UPDATE on the virtual subresource - // of managedclusters/accept. - // When the value is set true, a namespace whose name is the same as the name of ManagedCluster - // is created on the hub. This namespace represents the managed cluster, also role/rolebinding is created on - // the namespace to grant the permision of access from the agent on the managed cluster. - // When the value is set to false, the namespace representing the managed cluster is - // deleted. - // +required - HubAcceptsClient bool `json:"hubAcceptsClient"` - - // LeaseDurationSeconds is used to coordinate the lease update time of Klusterlet agents on the managed cluster. - // If its value is zero, the Klusterlet agent will update its lease every 60 seconds by default - // +optional - // +kubebuilder:default=60 - LeaseDurationSeconds int32 `json:"leaseDurationSeconds,omitempty"` - - // Taints is a property of managed cluster that allow the cluster to be repelled when scheduling. - // Taints, including 'ManagedClusterUnavailable' and 'ManagedClusterUnreachable', can not be added/removed by agent - // running on the managed cluster; while it's fine to add/remove other taints from either hub cluser or managed cluster. - // +optional - Taints []Taint `json:"taints,omitempty"` -} - -// ClientConfig represents the apiserver address of the managed cluster. -// TODO include credential to connect to managed cluster kube-apiserver -type ClientConfig struct { - // URL is the URL of apiserver endpoint of the managed cluster. - // +required - URL string `json:"url"` - - // CABundle is the ca bundle to connect to apiserver of the managed cluster. - // System certs are used if it is not set. - // +optional - CABundle []byte `json:"caBundle,omitempty"` -} - -// The managed cluster this Taint is attached to has the "effect" on -// any placement that does not tolerate the Taint. -type Taint struct { - // Key is the taint key applied to a cluster. e.g. bar or foo.example.com/bar. - // The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - // +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 - // +required - Key string `json:"key"` - // Value is the taint value corresponding to the taint key. - // +kubebuilder:validation:MaxLength=1024 - // +optional - Value string `json:"value,omitempty"` - // Effect indicates the effect of the taint on placements that do not tolerate the taint. - // Valid effects are NoSelect, PreferNoSelect and NoSelectIfNew. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum:=NoSelect;PreferNoSelect;NoSelectIfNew - // +required - Effect TaintEffect `json:"effect"` - // TimeAdded represents the time at which the taint was added. - // +nullable - // +required - TimeAdded metav1.Time `json:"timeAdded"` -} - -type TaintEffect string - -const ( - // TaintEffectNoSelect means placements are not allowed to select the cluster unless they tolerate the taint. - // The cluster will be removed from the placement cluster decisions if a placement has already selected - // this cluster. - TaintEffectNoSelect TaintEffect = "NoSelect" - // TaintEffectPreferNoSelect means the scheduler tries not to select the cluster, rather than prohibiting - // placements from selecting the cluster entirely. - TaintEffectPreferNoSelect TaintEffect = "PreferNoSelect" - // TaintEffectNoSelectIfNew means placements are not allowed to select the cluster unless - // 1) they tolerate the taint; - // 2) they have already had the cluster in their cluster decisions; - TaintEffectNoSelectIfNew TaintEffect = "NoSelectIfNew" -) - -const ( - // ManagedClusterTaintUnavailable is the key of the taint added to a managed cluster when it is not available. - // To be specific, the cluster has a condition 'ManagedClusterConditionAvailable' with status of 'False'; - ManagedClusterTaintUnavailable string = "cluster.open-cluster-management.io/unavailable" - // ManagedClusterTaintUnreachable is the key of the taint added to a managed cluster when it is not reachable. - // To be specific, - // 1) The cluster has no condition 'ManagedClusterConditionAvailable'; - // 2) Or the status of condition 'ManagedClusterConditionAvailable' is 'Unknown'; - ManagedClusterTaintUnreachable string = "cluster.open-cluster-management.io/unreachable" -) - -// ManagedClusterStatus represents the current status of joined managed cluster. -type ManagedClusterStatus struct { - // Conditions contains the different condition statuses for this managed cluster. - Conditions []metav1.Condition `json:"conditions"` - - // Capacity represents the total resource capacity from all nodeStatuses - // on the managed cluster. - Capacity ResourceList `json:"capacity,omitempty"` - - // Allocatable represents the total allocatable resources on the managed cluster. - Allocatable ResourceList `json:"allocatable,omitempty"` - - // Version represents the kubernetes version of the managed cluster. - Version ManagedClusterVersion `json:"version,omitempty"` - - // ClusterClaims represents cluster information that a managed cluster claims, - // for example a unique cluster identifier (id.k8s.io) and kubernetes version - // (kubeversion.open-cluster-management.io). They are written from the managed - // cluster. The set of claims is not uniform across a fleet, some claims can be - // vendor or version specific and may not be included from all managed clusters. - // +optional - ClusterClaims []ManagedClusterClaim `json:"clusterClaims,omitempty"` -} - -// ManagedClusterVersion represents version information about the managed cluster. -// TODO add managed agent versions -type ManagedClusterVersion struct { - // Kubernetes is the kubernetes version of managed cluster. - // +optional - Kubernetes string `json:"kubernetes,omitempty"` -} - -// ManagedClusterClaim represents a ClusterClaim collected from a managed cluster. -type ManagedClusterClaim struct { - // Name is the name of a ClusterClaim resource on managed cluster. It's a well known - // or customized name to identify the claim. - // +kubebuilder:validation:MaxLength=253 - // +kubebuilder:validation:MinLength=1 - Name string `json:"name,omitempty"` - - // Value is a claim-dependent string - // +kubebuilder:validation:MaxLength=1024 - // +kubebuilder:validation:MinLength=1 - Value string `json:"value,omitempty"` -} - -const ( - // ManagedClusterConditionJoined means the managed cluster has successfully joined the hub. - ManagedClusterConditionJoined string = "ManagedClusterJoined" - // ManagedClusterConditionHubAccepted means the request to join the cluster is - // approved by cluster-admin on hub. - ManagedClusterConditionHubAccepted string = "HubAcceptedManagedCluster" - // ManagedClusterConditionHubDenied means the request to join the cluster is denied by - // cluster-admin on hub. - ManagedClusterConditionHubDenied string = "HubDeniedManagedCluster" - // ManagedClusterConditionAvailable means the managed cluster is available. If a managed - // cluster is available, the kube-apiserver is healthy and the Klusterlet agent is - // running with the minimum deployment on this managed cluster - ManagedClusterConditionAvailable string = "ManagedClusterConditionAvailable" - // ManagedClusterConditionClockSynced means the clock between the hub and the agent is synced. - ManagedClusterConditionClockSynced string = "ManagedClusterConditionClockSynced" -) - -// ResourceName is the name identifying various resources in a ResourceList. -type ResourceName string - -const ( - // ResourceCPU defines the number of CPUs in cores. (500m = .5 cores) - ResourceCPU ResourceName = "cpu" - // ResourceMemory defines the amount of memory in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) - ResourceMemory ResourceName = "memory" -) - -// ResourceList defines a map for the quantity of different resources, the definition -// matches the ResourceList defined in k8s.io/api/core/v1. -type ResourceList map[ResourceName]resource.Quantity - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ManagedClusterList is a collection of managed cluster. -type ManagedClusterList 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 managed clusters. - Items []ManagedCluster `json:"items"` -} - -const ( - // ClusterNameLabelKey is the key of a label to set ManagedCluster name. - ClusterNameLabelKey = "open-cluster-management.io/cluster-name" -) - -const ( - // ClusterImageRegistriesAnnotationKey is an annotation key on ManagedCluster to configure image override for addons - // running on the ManagedCluster, the value of the annotation should be a json string like this: - // - // { - // "registries": [ - // { - // "source": "quay.io/ocm", - // "mirrors": "quay.io/open-cluster-management" - // } - // ] - // } - // - // Note: Image registries configured in the addonDeploymentConfig will take precedence over this annotation. - ClusterImageRegistriesAnnotationKey = "open-cluster-management.io/image-registries" -) - -const ( - // ManagedClusterFinalizer is the name of the finalizer added to ManagedCluster, it is to ensure that resources - // relating to the ManagedCluster is removed when the ManagedCluster is deleted. - ManagedClusterFinalizer = "cluster.open-cluster-management.io/api-resource-cleanup" -) - -const ( - // ManagedClusterConditionDeleting is a condition which means the cluster is in deletion process. - ManagedClusterConditionDeleting string = "Deleting" - - // ConditionDeletingReasonResourceRemaining is a reason for the condition ManagedClusterConditionDeleting, which means - // there are resources are remaining during deletion process. - ConditionDeletingReasonResourceRemaining string = "ResourceRemaining" - - // ConditionDeletingReasonNoResource is a reason for the condition ManagedClusterConditionDeleting, which means - // there is no resources left in the cluster ns during the deletion process. - ConditionDeletingReasonNoResource string = "NoResource" - - // ConditionDeletingReasonResourceError is a reason for the condition ManagedClusterConditionDeleting, which means - // meet errors during the deletion process. - ConditionDeletingReasonResourceError string = "DeletingError" - - // CleanupPriorityAnnotationKey is an annotation for the resources deployed in cluster ns which are waiting to - // be cleaned up after cluster is deleted. - // The value is an integer value [0,100], The larger the value, the later the order of deletion. - // The deletion order is : - // 1. delete resources without this annotation firstly. - // 2. delete resources with invalid value of this annotation (!= [0,100]). - // 3. delete resources following the priority value. For example, there are 2 manifestWorks, one value is set 100 - // and another is set 10, the manifestWorks with 10 will be deleted before the one with 100. - CleanupPriorityAnnotationKey string = "open-cluster-management.io/cleanup-priority" -) diff --git a/vendor/open-cluster-management.io/api/cluster/v1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/cluster/v1/zz_generated.deepcopy.go deleted file mode 100644 index 19a63be914..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,237 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - metav1 "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 *ClientConfig) DeepCopyInto(out *ClientConfig) { - *out = *in - if in.CABundle != nil { - in, out := &in.CABundle, &out.CABundle - *out = make([]byte, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConfig. -func (in *ClientConfig) DeepCopy() *ClientConfig { - if in == nil { - return nil - } - out := new(ClientConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedCluster) DeepCopyInto(out *ManagedCluster) { - *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 ManagedCluster. -func (in *ManagedCluster) DeepCopy() *ManagedCluster { - if in == nil { - return nil - } - out := new(ManagedCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ManagedCluster) 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 *ManagedClusterClaim) DeepCopyInto(out *ManagedClusterClaim) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterClaim. -func (in *ManagedClusterClaim) DeepCopy() *ManagedClusterClaim { - if in == nil { - return nil - } - out := new(ManagedClusterClaim) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedClusterList) DeepCopyInto(out *ManagedClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ManagedCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterList. -func (in *ManagedClusterList) DeepCopy() *ManagedClusterList { - if in == nil { - return nil - } - out := new(ManagedClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ManagedClusterList) 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 *ManagedClusterSpec) DeepCopyInto(out *ManagedClusterSpec) { - *out = *in - if in.ManagedClusterClientConfigs != nil { - in, out := &in.ManagedClusterClientConfigs, &out.ManagedClusterClientConfigs - *out = make([]ClientConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSpec. -func (in *ManagedClusterSpec) DeepCopy() *ManagedClusterSpec { - if in == nil { - return nil - } - out := new(ManagedClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedClusterStatus) DeepCopyInto(out *ManagedClusterStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - out.Version = in.Version - if in.ClusterClaims != nil { - in, out := &in.ClusterClaims, &out.ClusterClaims - *out = make([]ManagedClusterClaim, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterStatus. -func (in *ManagedClusterStatus) DeepCopy() *ManagedClusterStatus { - if in == nil { - return nil - } - out := new(ManagedClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedClusterVersion) DeepCopyInto(out *ManagedClusterVersion) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterVersion. -func (in *ManagedClusterVersion) DeepCopy() *ManagedClusterVersion { - if in == nil { - return nil - } - out := new(ManagedClusterVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in ResourceList) DeepCopyInto(out *ResourceList) { - { - in := &in - *out = make(ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList. -func (in ResourceList) DeepCopy() ResourceList { - if in == nil { - return nil - } - out := new(ResourceList) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Taint) DeepCopyInto(out *Taint) { - *out = *in - in.TimeAdded.DeepCopyInto(&out.TimeAdded) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. -func (in *Taint) DeepCopy() *Taint { - if in == nil { - return nil - } - out := new(Taint) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/open-cluster-management.io/api/cluster/v1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/cluster/v1/zz_generated.swagger_doc_generated.go deleted file mode 100644 index 61e71b6067..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1/zz_generated.swagger_doc_generated.go +++ /dev/null @@ -1,100 +0,0 @@ -package v1 - -// 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_ClientConfig = map[string]string{ - "": "ClientConfig represents the apiserver address of the managed cluster.", - "url": "URL is the URL of apiserver endpoint of the managed cluster.", - "caBundle": "CABundle is the ca bundle to connect to apiserver of the managed cluster. System certs are used if it is not set.", -} - -func (ClientConfig) SwaggerDoc() map[string]string { - return map_ClientConfig -} - -var map_ManagedCluster = map[string]string{ - "": "ManagedCluster represents the desired state and current status of a managed cluster. ManagedCluster is a cluster-scoped resource. The name is the cluster UID.\n\nThe cluster join process is a double opt-in process. See the following join process steps:\n\n1. The agent on the managed cluster creates a CSR on the hub with the cluster UID and agent name. 2. The agent on the managed cluster creates a ManagedCluster on the hub. 3. The cluster admin on the hub cluster approves the CSR for the UID and agent name of the ManagedCluster. 4. The cluster admin sets the spec.acceptClient of the ManagedCluster to true. 5. The cluster admin on the managed cluster creates a credential of the kubeconfig for the hub cluster.\n\nAfter the hub cluster creates the cluster namespace, the klusterlet agent on the ManagedCluster pushes the credential to the hub cluster to use against the kube-apiserver of the ManagedCluster.", - "spec": "Spec represents a desired configuration for the agent on the managed cluster.", - "status": "Status represents the current status of joined managed cluster", -} - -func (ManagedCluster) SwaggerDoc() map[string]string { - return map_ManagedCluster -} - -var map_ManagedClusterClaim = map[string]string{ - "": "ManagedClusterClaim represents a ClusterClaim collected from a managed cluster.", - "name": "Name is the name of a ClusterClaim resource on managed cluster. It's a well known or customized name to identify the claim.", - "value": "Value is a claim-dependent string", -} - -func (ManagedClusterClaim) SwaggerDoc() map[string]string { - return map_ManagedClusterClaim -} - -var map_ManagedClusterList = map[string]string{ - "": "ManagedClusterList is a collection of managed cluster.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of managed clusters.", -} - -func (ManagedClusterList) SwaggerDoc() map[string]string { - return map_ManagedClusterList -} - -var map_ManagedClusterSpec = map[string]string{ - "": "ManagedClusterSpec provides the information to securely connect to a remote server and verify its identity.", - "managedClusterClientConfigs": "ManagedClusterClientConfigs represents a list of the apiserver address of the managed cluster. If it is empty, the managed cluster has no accessible address for the hub to connect with it.", - "hubAcceptsClient": "hubAcceptsClient represents that hub accepts the joining of Klusterlet agent on the managed cluster with the hub. The default value is false, and can only be set true when the user on hub has an RBAC rule to UPDATE on the virtual subresource of managedclusters/accept. When the value is set true, a namespace whose name is the same as the name of ManagedCluster is created on the hub. This namespace represents the managed cluster, also role/rolebinding is created on the namespace to grant the permision of access from the agent on the managed cluster. When the value is set to false, the namespace representing the managed cluster is deleted.", - "leaseDurationSeconds": "LeaseDurationSeconds is used to coordinate the lease update time of Klusterlet agents on the managed cluster. If its value is zero, the Klusterlet agent will update its lease every 60 seconds by default", - "taints": "Taints is a property of managed cluster that allow the cluster to be repelled when scheduling. Taints, including 'ManagedClusterUnavailable' and 'ManagedClusterUnreachable', can not be added/removed by agent running on the managed cluster; while it's fine to add/remove other taints from either hub cluser or managed cluster.", -} - -func (ManagedClusterSpec) SwaggerDoc() map[string]string { - return map_ManagedClusterSpec -} - -var map_ManagedClusterStatus = map[string]string{ - "": "ManagedClusterStatus represents the current status of joined managed cluster.", - "conditions": "Conditions contains the different condition statuses for this managed cluster.", - "capacity": "Capacity represents the total resource capacity from all nodeStatuses on the managed cluster.", - "allocatable": "Allocatable represents the total allocatable resources on the managed cluster.", - "version": "Version represents the kubernetes version of the managed cluster.", - "clusterClaims": "ClusterClaims represents cluster information that a managed cluster claims, for example a unique cluster identifier (id.k8s.io) and kubernetes version (kubeversion.open-cluster-management.io). They are written from the managed cluster. The set of claims is not uniform across a fleet, some claims can be vendor or version specific and may not be included from all managed clusters.", -} - -func (ManagedClusterStatus) SwaggerDoc() map[string]string { - return map_ManagedClusterStatus -} - -var map_ManagedClusterVersion = map[string]string{ - "": "ManagedClusterVersion represents version information about the managed cluster.", - "kubernetes": "Kubernetes is the kubernetes version of managed cluster.", -} - -func (ManagedClusterVersion) SwaggerDoc() map[string]string { - return map_ManagedClusterVersion -} - -var map_Taint = map[string]string{ - "": "The managed cluster this Taint is attached to has the \"effect\" on any placement that does not tolerate the Taint.", - "key": "Key is the taint key applied to a cluster. e.g. bar or foo.example.com/bar. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)", - "value": "Value is the taint value corresponding to the taint key.", - "effect": "Effect indicates the effect of the taint on placements that do not tolerate the taint. Valid effects are NoSelect, PreferNoSelect and NoSelectIfNew.", - "timeAdded": "TimeAdded represents the time at which the taint was added.", -} - -func (Taint) SwaggerDoc() map[string]string { - return map_Taint -} - -// AUTO-GENERATED FUNCTIONS END HERE 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 deleted file mode 100644 index 5355bb16d7..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clusterclaims.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: ClusterClaim - listKind: ClusterClaimList - plural: clusterclaims - singular: clusterclaim - preserveUnknownFields: false - scope: Cluster - versions: - - 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. - \n ClusterClaims created on a managed cluster will be collected and saved - into the status of the corresponding ManagedCluster on hub." - 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 ClusterClaim. - properties: - value: - description: Value is a claim-dependent string - maxLength: 1024 - minLength: 1 - type: string - type: object - type: object - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml deleted file mode 100644 index 1cfba5564a..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml +++ /dev/null @@ -1,153 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: addonplacementscores.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: AddOnPlacementScore - listKind: AddOnPlacementScoreList - plural: addonplacementscores - singular: addonplacementscore - preserveUnknownFields: false - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: 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. - 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 status of the AddOnPlacementScore. - properties: - conditions: - description: Conditions contain the different condition statuses for - this AddOnPlacementScore. - 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, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - scores: - description: Scores contain a list of score name and value of this - managed cluster. - items: - description: AddOnPlacementScoreItem represents the score name and - value. - properties: - name: - description: Name is the name of the score - type: string - value: - description: Value is the value of the score. The score range - is from -100 to 100. - format: int32 - maximum: 100 - minimum: -100 - type: integer - required: - - name - - value - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - validUntil: - description: ValidUntil defines the valid time of the scores. After - this time, the scores are considered to be invalid by placement. - nil means never expire. The controller owning this resource should - keep the scores up-to-date. - format: date-time - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/doc.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/doc.go deleted file mode 100644 index 93f37581ca..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package v1alpha1 contains API Schema definitions for the cluster v1alpha1 API group -// +k8s:deepcopy-gen=package,register -// +k8s:openapi-gen=true - -// +kubebuilder:validation:Optional -// +groupName=cluster.open-cluster-management.io -package v1alpha1 diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go deleted file mode 100644 index 36b73ce2ff..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/register.go +++ /dev/null @@ -1,40 +0,0 @@ -package v1alpha1 - -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: "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, - &AddOnPlacementScore{}, - &AddOnPlacementScoreList{}, - &ClusterClaim{}, - &ClusterClaimList{}, - ) - 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 deleted file mode 100644 index 6cb57bc3b4..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types.go +++ /dev/null @@ -1,61 +0,0 @@ -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:scope="Cluster" - -// 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. -type ClusterClaim struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the attributes of the ClusterClaim. - Spec ClusterClaimSpec `json:"spec,omitempty"` -} - -type ClusterClaimSpec struct { - // Value is a claim-dependent string - // +kubebuilder:validation:MaxLength=1024 - // +kubebuilder:validation:MinLength=1 - Value string `json:"value,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterClaimList is a collection of ClusterClaim. -type ClusterClaimList 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 ClusterClaim. - Items []ClusterClaim `json:"items"` -} - -// ReservedClusterClaimNames includes a list of reserved names for ClusterNames. -// When exposing ClusterClaims created on managed cluster, the registration agent gives high -// priority to the reserved ClusterClaims. -var ReservedClusterClaimNames = [...]string{ - // unique identifier for the cluster - "id.k8s.io", - // kubernetes version - "kubeversion.open-cluster-management.io", - // platform the managed cluster is running on, like AWS, GCE, and Equinix Metal - "platform.open-cluster-management.io", - // product name, like OpenShift, Anthos, EKS and GKE - "product.open-cluster-management.io", -} 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 deleted file mode 100644 index 1ce73580bd..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_addonplacementscore.go +++ /dev/null @@ -1,75 +0,0 @@ -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:scope="Namespaced" -// +kubebuilder:subresource:status - -// 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. -type AddOnPlacementScore struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Status represents the status of the AddOnPlacementScore. - // +optional - Status AddOnPlacementScoreStatus `json:"status,omitempty"` -} - -// AddOnPlacementScoreStatus represents the current status of AddOnPlacementScore. -type AddOnPlacementScoreStatus struct { - // Conditions contain the different condition statuses for this AddOnPlacementScore. - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` - - // Scores contain a list of score name and value of this managed cluster. - // +listType=map - // +listMapKey=name - // +optional - Scores []AddOnPlacementScoreItem `json:"scores,omitempty"` - - // ValidUntil defines the valid time of the scores. - // After this time, the scores are considered to be invalid by placement. nil means never expire. - // The controller owning this resource should keep the scores up-to-date. - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=date-time - // +optional - ValidUntil *metav1.Time `json:"validUntil"` -} - -// AddOnPlacementScoreItem represents the score name and value. -type AddOnPlacementScoreItem struct { - // Name is the name of the score - // +kubebuilder:validation:Required - // +required - Name string `json:"name"` - - // Value is the value of the score. The score range is from -100 to 100. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum:=-100 - // +kubebuilder:validation:Maximum:=100 - // +required - Value int32 `json:"value"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AddOnPlacementScoreList is a collection of AddOnPlacementScore. -type AddOnPlacementScoreList 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 AddOnPlacementScore - Items []AddOnPlacementScore `json:"items"` -} diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_rolloutstrategy.go b/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_rolloutstrategy.go deleted file mode 100644 index 2c863bb50e..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/types_rolloutstrategy.go +++ /dev/null @@ -1,148 +0,0 @@ -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// +k8s:deepcopy-gen=true - -// RolloutStrategy API used by workload applier APIs to define how the workload will be applied to -// the selected clusters by the Placement and DecisionStrategy. - -type RolloutType string - -const ( - //All means apply the workload to all clusters in the decision groups at once. - All RolloutType = "All" - //Progressive means apply the workload to the selected clusters progressively per cluster. - Progressive RolloutType = "Progressive" - //ProgressivePerGroup means apply the workload to the selected clusters progressively per group. - ProgressivePerGroup RolloutType = "ProgressivePerGroup" -) - -// Rollout strategy to apply workload to the selected clusters by Placement and DecisionStrategy. -type RolloutStrategy struct { - // Rollout strategy Types are All, Progressive and ProgressivePerGroup - // 1) All means apply the workload to all clusters in the decision groups at once. - // 2) Progressive means apply the workload to the selected clusters progressively per cluster. The - // workload will not be applied to the next cluster unless one of the current applied clusters - // reach the successful state and haven't breached the MaxFailures configuration. - // 3) ProgressivePerGroup means apply the workload to decisionGroup clusters progressively per - // group. The workload will not be applied to the next decisionGroup unless all clusters in the - // current group reach the successful state and haven't breached the MaxFailures configuration. - - // +kubebuilder:validation:Enum=All;Progressive;ProgressivePerGroup - // +kubebuilder:default:=All - // +optional - Type RolloutType `json:"type,omitempty"` - - // All defines required fields for RolloutStrategy type All - // +optional - All *RolloutAll `json:"all,omitempty"` - - // Progressive defines required fields for RolloutStrategy type Progressive - // +optional - Progressive *RolloutProgressive `json:"progressive,omitempty"` - - // ProgressivePerGroup defines required fields for RolloutStrategy type ProgressivePerGroup - // +optional - ProgressivePerGroup *RolloutProgressivePerGroup `json:"progressivePerGroup,omitempty"` -} - -// Timeout to consider while applying the workload. -type RolloutConfig struct { - // MinSuccessTime is a "soak" time. In other words, the minimum amount of time the workload - // applier controller will wait from the start of each rollout before proceeding (assuming a - // successful state has been reached and MaxFailures wasn't breached). - // MinSuccessTime is only considered for rollout types Progressive and ProgressivePerGroup. - // The default value is 0 meaning the workload applier proceeds immediately after a successful - // state is reached. - // MinSuccessTime must be defined in [0-9h]|[0-9m]|[0-9s] format examples; 2h , 90m , 360s - // +kubebuilder:default:="0" - // +optional - MinSuccessTime metav1.Duration `json:"minSuccessTime,omitempty"` - // ProgressDeadline defines how long workload applier controller will wait for the workload to - // reach a successful state in the cluster. - // If the workload does not reach a successful state after ProgressDeadline, will stop waiting - // and workload will be treated as "timeout" and be counted into MaxFailures. Once the MaxFailures - // is breached, the rollout will stop. - // ProgressDeadline default value is "None", meaning the workload applier will wait for a - // successful state indefinitely. - // ProgressDeadline must be defined in [0-9h]|[0-9m]|[0-9s] format examples; 2h , 90m , 360s - // +kubebuilder:validation:Pattern="^(([0-9])+[h|m|s])|None$" - // +kubebuilder:default:="None" - // +optional - ProgressDeadline string `json:"progressDeadline,omitempty"` - // MaxFailures is a percentage or number of clusters in the current rollout that can fail before - // proceeding to the next rollout. Fail means the cluster has a failed status or timeout status - // (does not reach successful status after ProgressDeadline). - // Once the MaxFailures is breached, the rollout will stop. - // MaxFailures is only considered for rollout types Progressive and ProgressivePerGroup. For - // Progressive, this is considered over the total number of clusters. For ProgressivePerGroup, - // this is considered according to the size of the current group. For both Progressive and - // ProgressivePerGroup, the MaxFailures does not apply for MandatoryDecisionGroups, which tolerate - // no failures. - // Default is that no failures are tolerated. - // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" - // +kubebuilder:validation:XIntOrString - // +kubebuilder:default=0 - // +optional - MaxFailures intstr.IntOrString `json:"maxFailures,omitempty"` -} - -// MandatoryDecisionGroup set the decision group name or group index. -// GroupName is considered first to select the decisionGroups then GroupIndex. -type MandatoryDecisionGroup struct { - // GroupName of the decision group should match the placementDecisions label value with label key - // cluster.open-cluster-management.io/decision-group-name - // +optional - GroupName string `json:"groupName,omitempty"` - - // GroupIndex of the decision group should match the placementDecisions label value with label key - // cluster.open-cluster-management.io/decision-group-index - // +optional - GroupIndex int32 `json:"groupIndex,omitempty"` -} - -// MandatoryDecisionGroups -type MandatoryDecisionGroups struct { - // List of the decision groups names or indexes to apply the workload first and fail if workload - // did not reach successful state. - // GroupName or GroupIndex must match with the decisionGroups defined in the placement's - // decisionStrategy - // +optional - MandatoryDecisionGroups []MandatoryDecisionGroup `json:"mandatoryDecisionGroups,omitempty"` -} - -// RolloutAll is a RolloutStrategy Type -type RolloutAll struct { - // +optional - RolloutConfig `json:",inline"` -} - -// RolloutProgressivePerGroup is a RolloutStrategy Type -type RolloutProgressivePerGroup struct { - // +optional - RolloutConfig `json:",inline"` - - // +optional - MandatoryDecisionGroups `json:",inline"` -} - -// RolloutProgressive is a RolloutStrategy Type -type RolloutProgressive struct { - // +optional - RolloutConfig `json:",inline"` - - // +optional - MandatoryDecisionGroups `json:",inline"` - - // MaxConcurrency is the max number of clusters to deploy workload concurrently. The default value - // for MaxConcurrency is determined from the clustersPerDecisionGroup defined in the - // placement->DecisionStrategy. - // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" - // +kubebuilder:validation:XIntOrString - // +optional - MaxConcurrency intstr.IntOrString `json:"maxConcurrency,omitempty"` -} 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 deleted file mode 100644 index e40f74e4d2..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,335 +0,0 @@ -//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 *AddOnPlacementScore) DeepCopyInto(out *AddOnPlacementScore) { - *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 AddOnPlacementScore. -func (in *AddOnPlacementScore) DeepCopy() *AddOnPlacementScore { - if in == nil { - return nil - } - out := new(AddOnPlacementScore) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AddOnPlacementScore) 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 *AddOnPlacementScoreItem) DeepCopyInto(out *AddOnPlacementScoreItem) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnPlacementScoreItem. -func (in *AddOnPlacementScoreItem) DeepCopy() *AddOnPlacementScoreItem { - if in == nil { - return nil - } - out := new(AddOnPlacementScoreItem) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AddOnPlacementScoreList) DeepCopyInto(out *AddOnPlacementScoreList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AddOnPlacementScore, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnPlacementScoreList. -func (in *AddOnPlacementScoreList) DeepCopy() *AddOnPlacementScoreList { - if in == nil { - return nil - } - out := new(AddOnPlacementScoreList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AddOnPlacementScoreList) 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 *AddOnPlacementScoreStatus) DeepCopyInto(out *AddOnPlacementScoreStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Scores != nil { - in, out := &in.Scores, &out.Scores - *out = make([]AddOnPlacementScoreItem, len(*in)) - copy(*out, *in) - } - if in.ValidUntil != nil { - in, out := &in.ValidUntil, &out.ValidUntil - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnPlacementScoreStatus. -func (in *AddOnPlacementScoreStatus) DeepCopy() *AddOnPlacementScoreStatus { - if in == nil { - return nil - } - out := new(AddOnPlacementScoreStatus) - 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 - 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 ClusterClaim. -func (in *ClusterClaim) DeepCopy() *ClusterClaim { - if in == nil { - return nil - } - out := new(ClusterClaim) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterClaim) 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 *ClusterClaimList) DeepCopyInto(out *ClusterClaimList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterClaim, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClaimList. -func (in *ClusterClaimList) DeepCopy() *ClusterClaimList { - if in == nil { - return nil - } - out := new(ClusterClaimList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterClaimList) 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 *ClusterClaimSpec) DeepCopyInto(out *ClusterClaimSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClaimSpec. -func (in *ClusterClaimSpec) DeepCopy() *ClusterClaimSpec { - if in == nil { - return nil - } - out := new(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 *MandatoryDecisionGroup) DeepCopyInto(out *MandatoryDecisionGroup) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MandatoryDecisionGroup. -func (in *MandatoryDecisionGroup) DeepCopy() *MandatoryDecisionGroup { - if in == nil { - return nil - } - out := new(MandatoryDecisionGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MandatoryDecisionGroups) DeepCopyInto(out *MandatoryDecisionGroups) { - *out = *in - if in.MandatoryDecisionGroups != nil { - in, out := &in.MandatoryDecisionGroups, &out.MandatoryDecisionGroups - *out = make([]MandatoryDecisionGroup, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MandatoryDecisionGroups. -func (in *MandatoryDecisionGroups) DeepCopy() *MandatoryDecisionGroups { - if in == nil { - return nil - } - out := new(MandatoryDecisionGroups) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutAll) DeepCopyInto(out *RolloutAll) { - *out = *in - out.RolloutConfig = in.RolloutConfig - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutAll. -func (in *RolloutAll) DeepCopy() *RolloutAll { - if in == nil { - return nil - } - out := new(RolloutAll) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutConfig) DeepCopyInto(out *RolloutConfig) { - *out = *in - out.MinSuccessTime = in.MinSuccessTime - out.MaxFailures = in.MaxFailures - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutConfig. -func (in *RolloutConfig) DeepCopy() *RolloutConfig { - if in == nil { - return nil - } - out := new(RolloutConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutProgressive) DeepCopyInto(out *RolloutProgressive) { - *out = *in - out.RolloutConfig = in.RolloutConfig - in.MandatoryDecisionGroups.DeepCopyInto(&out.MandatoryDecisionGroups) - out.MaxConcurrency = in.MaxConcurrency - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutProgressive. -func (in *RolloutProgressive) DeepCopy() *RolloutProgressive { - if in == nil { - return nil - } - out := new(RolloutProgressive) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutProgressivePerGroup) DeepCopyInto(out *RolloutProgressivePerGroup) { - *out = *in - out.RolloutConfig = in.RolloutConfig - in.MandatoryDecisionGroups.DeepCopyInto(&out.MandatoryDecisionGroups) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutProgressivePerGroup. -func (in *RolloutProgressivePerGroup) DeepCopy() *RolloutProgressivePerGroup { - if in == nil { - return nil - } - out := new(RolloutProgressivePerGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutStrategy) DeepCopyInto(out *RolloutStrategy) { - *out = *in - if in.All != nil { - in, out := &in.All, &out.All - *out = new(RolloutAll) - **out = **in - } - if in.Progressive != nil { - in, out := &in.Progressive, &out.Progressive - *out = new(RolloutProgressive) - (*in).DeepCopyInto(*out) - } - if in.ProgressivePerGroup != nil { - in, out := &in.ProgressivePerGroup, &out.ProgressivePerGroup - *out = new(RolloutProgressivePerGroup) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStrategy. -func (in *RolloutStrategy) DeepCopy() *RolloutStrategy { - if in == nil { - return nil - } - out := new(RolloutStrategy) - 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 deleted file mode 100644 index 64c51d2466..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/zz_generated.swagger_doc_generated.go +++ /dev/null @@ -1,147 +0,0 @@ -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_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.\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.", -} - -func (ClusterClaim) SwaggerDoc() map[string]string { - return map_ClusterClaim -} - -var map_ClusterClaimList = map[string]string{ - "": "ClusterClaimList is a collection of ClusterClaim.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of ClusterClaim.", -} - -func (ClusterClaimList) SwaggerDoc() map[string]string { - return map_ClusterClaimList -} - -var map_ClusterClaimSpec = map[string]string{ - "value": "Value is a claim-dependent string", -} - -func (ClusterClaimSpec) SwaggerDoc() map[string]string { - return map_ClusterClaimSpec -} - -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.", -} - -func (AddOnPlacementScore) SwaggerDoc() map[string]string { - return map_AddOnPlacementScore -} - -var map_AddOnPlacementScoreItem = map[string]string{ - "": "AddOnPlacementScoreItem represents the score name and value.", - "name": "Name is the name of the score", - "value": "Value is the value of the score. The score range is from -100 to 100.", -} - -func (AddOnPlacementScoreItem) SwaggerDoc() map[string]string { - return map_AddOnPlacementScoreItem -} - -var map_AddOnPlacementScoreList = map[string]string{ - "": "AddOnPlacementScoreList is a collection of AddOnPlacementScore.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of AddOnPlacementScore", -} - -func (AddOnPlacementScoreList) SwaggerDoc() map[string]string { - return map_AddOnPlacementScoreList -} - -var map_AddOnPlacementScoreStatus = map[string]string{ - "": "AddOnPlacementScoreStatus represents the current status of AddOnPlacementScore.", - "conditions": "Conditions contain the different condition statuses for this AddOnPlacementScore.", - "scores": "Scores contain a list of score name and value of this managed cluster.", - "validUntil": "ValidUntil defines the valid time of the scores. After this time, the scores are considered to be invalid by placement. nil means never expire. The controller owning this resource should keep the scores up-to-date.", -} - -func (AddOnPlacementScoreStatus) SwaggerDoc() map[string]string { - return map_AddOnPlacementScoreStatus -} - -var map_MandatoryDecisionGroup = map[string]string{ - "": "MandatoryDecisionGroup set the decision group name or group index. GroupName is considered first to select the decisionGroups then GroupIndex.", - "groupName": "GroupName of the decision group should match the placementDecisions label value with label key cluster.open-cluster-management.io/decision-group-name", - "groupIndex": "GroupIndex of the decision group should match the placementDecisions label value with label key cluster.open-cluster-management.io/decision-group-index", -} - -func (MandatoryDecisionGroup) SwaggerDoc() map[string]string { - return map_MandatoryDecisionGroup -} - -var map_MandatoryDecisionGroups = map[string]string{ - "": "MandatoryDecisionGroups", - "mandatoryDecisionGroups": "List of the decision groups names or indexes to apply the workload first and fail if workload did not reach successful state. GroupName or GroupIndex must match with the decisionGroups defined in the placement's decisionStrategy", -} - -func (MandatoryDecisionGroups) SwaggerDoc() map[string]string { - return map_MandatoryDecisionGroups -} - -var map_RolloutAll = map[string]string{ - "": "RolloutAll is a RolloutStrategy Type", -} - -func (RolloutAll) SwaggerDoc() map[string]string { - return map_RolloutAll -} - -var map_RolloutConfig = map[string]string{ - "": "Timeout to consider while applying the workload.", - "minSuccessTime": "MinSuccessTime is a \"soak\" time. In other words, the minimum amount of time the workload applier controller will wait from the start of each rollout before proceeding (assuming a successful state has been reached and MaxFailures wasn't breached). MinSuccessTime is only considered for rollout types Progressive and ProgressivePerGroup. The default value is 0 meaning the workload applier proceeds immediately after a successful state is reached. MinSuccessTime must be defined in [0-9h]|[0-9m]|[0-9s] format examples; 2h , 90m , 360s", - "progressDeadline": "ProgressDeadline defines how long workload applier controller will wait for the workload to reach a successful state in the cluster. If the workload does not reach a successful state after ProgressDeadline, will stop waiting and workload will be treated as \"timeout\" and be counted into MaxFailures. Once the MaxFailures is breached, the rollout will stop. ProgressDeadline default value is \"None\", meaning the workload applier will wait for a successful state indefinitely. ProgressDeadline must be defined in [0-9h]|[0-9m]|[0-9s] format examples; 2h , 90m , 360s", - "maxFailures": "MaxFailures is a percentage or number of clusters in the current rollout that can fail before proceeding to the next rollout. Fail means the cluster has a failed status or timeout status (does not reach successful status after ProgressDeadline). Once the MaxFailures is breached, the rollout will stop. MaxFailures is only considered for rollout types Progressive and ProgressivePerGroup. For Progressive, this is considered over the total number of clusters. For ProgressivePerGroup, this is considered according to the size of the current group. For both Progressive and ProgressivePerGroup, the MaxFailures does not apply for MandatoryDecisionGroups, which tolerate no failures. Default is that no failures are tolerated.", -} - -func (RolloutConfig) SwaggerDoc() map[string]string { - return map_RolloutConfig -} - -var map_RolloutProgressive = map[string]string{ - "": "RolloutProgressive is a RolloutStrategy Type", - "maxConcurrency": "MaxConcurrency is the max number of clusters to deploy workload concurrently. The default value for MaxConcurrency is determined from the clustersPerDecisionGroup defined in the placement->DecisionStrategy.", -} - -func (RolloutProgressive) SwaggerDoc() map[string]string { - return map_RolloutProgressive -} - -var map_RolloutProgressivePerGroup = map[string]string{ - "": "RolloutProgressivePerGroup is a RolloutStrategy Type", -} - -func (RolloutProgressivePerGroup) SwaggerDoc() map[string]string { - return map_RolloutProgressivePerGroup -} - -var map_RolloutStrategy = map[string]string{ - "": "Rollout strategy to apply workload to the selected clusters by Placement and DecisionStrategy.", - "all": "All defines required fields for RolloutStrategy type All", - "progressive": "Progressive defines required fields for RolloutStrategy type Progressive", - "progressivePerGroup": "ProgressivePerGroup defines required fields for RolloutStrategy type ProgressivePerGroup", -} - -func (RolloutStrategy) SwaggerDoc() map[string]string { - return map_RolloutStrategy -} - -// AUTO-GENERATED FUNCTIONS END HERE 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 deleted file mode 100644 index 7180e5ea42..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml +++ /dev/null @@ -1,673 +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 - preserveUnknownFields: false - scope: Namespaced - 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: 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 A ManagedCluster will not be selected if no ManagedClusterSet is bound - to the placement namespace. A user is able to bind a ManagedClusterSet to - a namespace by creating a ManagedClusterSetBinding in that namespace if - they have an RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. - \n A slice of PlacementDecisions with the 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." - 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. - 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. - items: - type: string - type: array - decisionStrategy: - description: DecisionStrategy divide the created placement decision - to groups and define number of clusters per decision group. - properties: - groupStrategy: - description: GroupStrategy define strategies to divide selected - clusters to decision groups. - properties: - clustersPerDecisionGroup: - anyOf: - - type: integer - - type: string - default: 100% - description: "ClustersPerDecisionGroup is a specific number - or percentage of the total selected clusters. The specific - number will divide the placementDecisions to decisionGroups - each group has max number of clusters equal to that specific - number. The percentage will divide the placementDecisions - to decisionGroups each group has max number of clusters - based on the total num of selected clusters and percentage. - ex; for a total 100 clusters selected, ClustersPerDecisionGroup - equal to 20% will divide the placement decision to 5 groups - each group should have 20 clusters. Default is having all - clusters in a single group. \n The predefined decisionGroups - is expected to be a subset of the selected clusters and - the number of items in each group SHOULD be less than ClustersPerDecisionGroup. - Once the number of items exceeds the ClustersPerDecisionGroup, - the decisionGroups will also be be divided into multiple - decisionGroups with same GroupName but different GroupIndex." - pattern: ^((100|[1-9][0-9]{0,1})%|[1-9][0-9]*)$ - x-kubernetes-int-or-string: true - decisionGroups: - description: DecisionGroups represents a list of predefined - groups to put decision results. Decision groups will be - constructed based on the DecisionGroups field at first. - The clusters not included in the DecisionGroups will be - divided to other decision groups afterwards. Each decision - group should not have the number of clusters larger than - the ClustersPerDecisionGroup. - items: - description: DecisionGroup define a subset of clusters that - will be added to placementDecisions with groupName label. - properties: - groupClusterSelector: - description: LabelSelector to select clusters subset - by label. - properties: - claimSelector: - description: ClaimSelector represents a selector - of ManagedClusters by clusterClaims in status - properties: - matchExpressions: - description: matchExpressions is a list of cluster - claim selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - labelSelector: - description: LabelSelector represents a selector - of ManagedClusters by label - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - type: object - groupName: - description: Group name to be added as label value to - the created placement Decisions labels with label - key cluster.open-cluster-management.io/decision-group-name - pattern: ^[a-zA-Z0-9][-A-Za-z0-9_.]{0,61}[a-zA-Z0-9]$ - type: string - required: - - groupClusterSelector - - groupName - type: object - type: array - type: object - type: object - 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; - format: int32 - type: integer - predicates: - description: Predicates represent a slice of predicates to select - ManagedClusters. The predicates are ORed. - items: - description: ClusterPredicate represents a predicate to select ManagedClusters. - 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); - properties: - claimSelector: - description: ClaimSelector represents a selector of ManagedClusters - by clusterClaims in status - properties: - matchExpressions: - description: matchExpressions is a list of cluster claim - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, - NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. - If the operator is In or NotIn, the values array - must be non-empty. If the operator is Exists - or DoesNotExist, the values array must be empty. - This array is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - labelSelector: - description: LabelSelector represents a selector of ManagedClusters - by label - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, - NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. - If the operator is In or NotIn, the values array - must be non-empty. If the operator is Exists - or DoesNotExist, the values array must be empty. - This array is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. - A single {key,value} in the matchLabels map is equivalent - to an element of matchExpressions, whose key field - is "key", the operator is "In", and the values array - contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - type: object - type: object - type: array - 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. - properties: - configurations: - items: - description: PrioritizerConfig represents the configuration - of prioritizer - properties: - scoreCoordinate: - description: ScoreCoordinate represents the configuration - of the prioritizer and score source. - properties: - addOn: - description: When type is "AddOn", AddOn defines the - resource name and score name. - 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 - required: - - resourceName - - scoreName - type: object - 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. 4) Spread: - spread the workload evenly to topologies.' - type: string - type: - default: BuiltIn - 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. - enum: - - BuiltIn - - AddOn - type: string - required: - - type - type: object - weight: - default: 1 - 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. - format: int32 - maximum: 10 - minimum: -10 - type: integer - required: - - scoreCoordinate - type: object - type: array - mode: - default: Additive - 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 - type: object - spreadPolicy: - description: SpreadPolicy defines how placement decisions should be - distributed among a set of ManagedClusters. - properties: - 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. - items: - description: SpreadConstraintsTerm defines a terminology to - spread placement decisions. - properties: - maxSkew: - default: 1 - 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. - format: int32 - minimum: 1 - type: integer - topologyKey: - description: TopologyKey is either a label key or a cluster - claim name of ManagedClusters. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ - type: string - topologyKeyType: - description: TopologyKeyType indicates the type of TopologyKey. - It could be Label or Claim. - enum: - - Label - - Claim - type: string - whenUnsatisfiable: - default: ScheduleAnyway - 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. - enum: - - DoNotSchedule - - ScheduleAnyway - type: string - required: - - topologyKey - - topologyKeyType - type: object - maxItems: 8 - type: array - type: object - 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. - 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 . - 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. - enum: - - NoSelect - - PreferNoSelect - - NoSelectIfNew - 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. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - operator: - default: Equal - 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 - 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. - format: int64 - type: integer - 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. - maxLength: 1024 - type: string - type: object - type: array - type: object - status: - description: Status represents the current status of the Placement - properties: - conditions: - description: Conditions contains the different condition status for - this Placement. - 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, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - decisionGroups: - description: List of decision groups determined by the placement and - DecisionStrategy. - items: - description: Present decision groups status based on the DecisionStrategy - definition. - properties: - clusterCount: - default: 0 - description: Total number of clusters in the decision group. - Clusters count is equal or less than the clusterPerDecisionGroups - defined in the decision strategy. - format: int32 - type: integer - decisionGroupIndex: - description: Present the decision group index. If there is no - decision strategy defined all placement decisions will be - in group index 0 - format: int32 - type: integer - decisionGroupName: - description: Decision group name that is defined in the DecisionStrategy's - DecisionGroup. - type: string - decisions: - description: List of placement decisions names associated with - the decision group - items: - type: string - type: array - type: object - type: array - numberOfSelectedClusters: - description: NumberOfSelectedClusters represents the number of selected - ManagedClusters - format: int32 - type: integer - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] 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 deleted file mode 100644 index f5bcc831da..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml +++ /dev/null @@ -1,76 +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 - preserveUnknownFields: false - scope: Namespaced - versions: - - name: v1beta1 - schema: - openAPIV3Schema: - description: "PlacementDecision indicates a decision from a placement. PlacementDecision - must have a cluster.open-cluster-management.io/placement={placement name} - label to reference a certain placement. \n If a placement has spec.numberOfClusters - specified, the total number of decisions contained in the status.decisions - of PlacementDecisions must be the same as NumberOfClusters. Otherwise, the - total number of decisions must equal the number of ManagedClusters that - match the placement requirements. \n Some of the decisions might be empty - when there are not enough ManagedClusters to meet the placement requirements." - 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 - properties: - decisions: - description: Decisions is a slice of decisions according to a placement - The number of decisions should not be larger than 100 - items: - description: ClusterDecision represents a decision from a placement - An empty ClusterDecision indicates it is not scheduled yet. - 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 - required: - - clusterName - - reason - type: object - type: array - required: - - decisions - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/doc.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/doc.go deleted file mode 100644 index 222d49af36..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package v1beta1 contains API Schema definitions for the cluster v1beta1 API group -// +k8s:deepcopy-gen=package,register -// +k8s:openapi-gen=true - -// +kubebuilder:validation:Optional -// +groupName=cluster.open-cluster-management.io -package v1beta1 diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/register.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/register.go deleted file mode 100644 index 0f9156d262..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/register.go +++ /dev/null @@ -1,40 +0,0 @@ -package v1beta1 - -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: "v1beta1"} - 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, - &Placement{}, - &PlacementList{}, - &PlacementDecision{}, - &PlacementDecisionList{}, - ) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} 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 deleted file mode 100644 index 637ca5a4be..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placement.go +++ /dev/null @@ -1,449 +0,0 @@ -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - v1 "open-cluster-management.io/api/cluster/v1" -) - -// +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. -// -// A ManagedCluster will not be selected if no ManagedClusterSet is bound to the placement -// namespace. A user is able to bind a ManagedClusterSet to a namespace by creating a -// ManagedClusterSetBinding in that namespace if they have an RBAC rule to CREATE on the virtual -// subresource of `managedclustersets/bind`. -// -// A slice of PlacementDecisions with the 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"` - - // 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 - Tolerations []Toleration `json:"tolerations,omitempty"` - - // DecisionStrategy divide the created placement decision to groups and define number of clusters per decision group. - // +optional - DecisionStrategy DecisionStrategy `json:"decisionStrategy,omitempty"` -} - -// DecisionGroup define a subset of clusters that will be added to placementDecisions with groupName label. -type DecisionGroup struct { - // Group name to be added as label value to the created placement Decisions labels with label key cluster.open-cluster-management.io/decision-group-name - // +kubebuilder:validation:Required - // +kubebuilder:validation:Pattern="^[a-zA-Z0-9][-A-Za-z0-9_.]{0,61}[a-zA-Z0-9]$" - // +required - GroupName string `json:"groupName,omitempty"` - - // LabelSelector to select clusters subset by label. - // +kubebuilder:validation:Required - // +required - ClusterSelector ClusterSelector `json:"groupClusterSelector,omitempty"` -} - -// Group the created placementDecision into decision groups based on the number of clusters per decision group. -type GroupStrategy struct { - // DecisionGroups represents a list of predefined groups to put decision results. - // Decision groups will be constructed based on the DecisionGroups field at first. The clusters not included in the - // DecisionGroups will be divided to other decision groups afterwards. Each decision group should not have the number - // of clusters larger than the ClustersPerDecisionGroup. - // +optional - DecisionGroups []DecisionGroup `json:"decisionGroups,omitempty"` - - // ClustersPerDecisionGroup is a specific number or percentage of the total selected clusters. - // The specific number will divide the placementDecisions to decisionGroups each group has max number of clusters - // equal to that specific number. - // The percentage will divide the placementDecisions to decisionGroups each group has max number of clusters based - // on the total num of selected clusters and percentage. - // ex; for a total 100 clusters selected, ClustersPerDecisionGroup equal to 20% will divide the placement decision - // to 5 groups each group should have 20 clusters. - // Default is having all clusters in a single group. - // - // The predefined decisionGroups is expected to be a subset of the selected clusters and the number of items in each - // group SHOULD be less than ClustersPerDecisionGroup. Once the number of items exceeds the ClustersPerDecisionGroup, - // the decisionGroups will also be be divided into multiple decisionGroups with same GroupName but different GroupIndex. - // - // +kubebuilder:validation:XIntOrString - // +kubebuilder:validation:Pattern=`^((100|[1-9][0-9]{0,1})%|[1-9][0-9]*)$` - // +kubebuilder:default:="100%" - // +optional - ClustersPerDecisionGroup intstr.IntOrString `json:"clustersPerDecisionGroup,omitempty"` -} - -// DecisionStrategy divide the created placement decision to groups and define number of clusters per decision group. -type DecisionStrategy struct { - // GroupStrategy define strategies to divide selected clusters to decision groups. - // +optional - GroupStrategy GroupStrategy `json:"groupStrategy,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 { - // ScoreCoordinate represents the configuration of the prioritizer and score source. - // +kubebuilder:validation:Required - // +required - 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. - // 4) Spread: spread the workload evenly to topologies. - // +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"` -} - -// 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 . -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" -) - -// Present decision groups status based on the DecisionStrategy definition. -type DecisionGroupStatus struct { - // Present the decision group index. If there is no decision strategy defined all placement decisions will be in group index 0 - // +optional - DecisionGroupIndex int32 `json:"decisionGroupIndex"` - - // Decision group name that is defined in the DecisionStrategy's DecisionGroup. - // +optional - DecisionGroupName string `json:"decisionGroupName"` - - // List of placement decisions names associated with the decision group - // +optional - Decisions []string `json:"decisions"` - - // Total number of clusters in the decision group. Clusters count is equal or less than the clusterPerDecisionGroups defined in the decision strategy. - // +kubebuilder:default:=0 - // +optional - ClustersCount int32 `json:"clusterCount"` -} - -type PlacementStatus struct { - // NumberOfSelectedClusters represents the number of selected ManagedClusters - // +optional - NumberOfSelectedClusters int32 `json:"numberOfSelectedClusters"` - - // List of decision groups determined by the placement and DecisionStrategy. - // +optional - DecisionGroups []DecisionGroupStatus `json:"decisionGroups"` - - // 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"` -} - -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 deleted file mode 100644 index 919a448cac..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/types_placementdecision.go +++ /dev/null @@ -1,74 +0,0 @@ -package v1beta1 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// +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 must have a cluster.open-cluster-management.io/placement={placement name} label to reference a certain placement. -// -// If a placement has spec.numberOfClusters specified, the total number of decisions contained in -// the status.decisions of PlacementDecisions must be the same as NumberOfClusters. Otherwise, the -// total number of decisions must equal the number of ManagedClusters that -// match the placement requirements. -// -// Some of the decisions might be empty when there are not enough ManagedClusters to 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 labels -const ( - // Placement owner name. - PlacementLabel string = "cluster.open-cluster-management.io/placement" - // decision group index. - DecisionGroupIndexLabel string = "cluster.open-cluster-management.io/decision-group-index" - // decision group name. - DecisionGroupNameLabel string = "cluster.open-cluster-management.io/decision-group-name" -) - -// 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/v1beta1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index cf2c2f1f01..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,518 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1beta1 - -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 *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 *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 *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 *DecisionGroup) DeepCopyInto(out *DecisionGroup) { - *out = *in - in.ClusterSelector.DeepCopyInto(&out.ClusterSelector) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecisionGroup. -func (in *DecisionGroup) DeepCopy() *DecisionGroup { - if in == nil { - return nil - } - out := new(DecisionGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DecisionGroupStatus) DeepCopyInto(out *DecisionGroupStatus) { - *out = *in - if in.Decisions != nil { - in, out := &in.Decisions, &out.Decisions - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecisionGroupStatus. -func (in *DecisionGroupStatus) DeepCopy() *DecisionGroupStatus { - if in == nil { - return nil - } - out := new(DecisionGroupStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DecisionStrategy) DeepCopyInto(out *DecisionStrategy) { - *out = *in - in.GroupStrategy.DeepCopyInto(&out.GroupStrategy) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecisionStrategy. -func (in *DecisionStrategy) DeepCopy() *DecisionStrategy { - if in == nil { - return nil - } - out := new(DecisionStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GroupStrategy) DeepCopyInto(out *GroupStrategy) { - *out = *in - if in.DecisionGroups != nil { - in, out := &in.DecisionGroups, &out.DecisionGroups - *out = make([]DecisionGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - out.ClustersPerDecisionGroup = in.ClustersPerDecisionGroup - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupStrategy. -func (in *GroupStrategy) DeepCopy() *GroupStrategy { - if in == nil { - return nil - } - out := new(GroupStrategy) - 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) - in.SpreadPolicy.DeepCopyInto(&out.SpreadPolicy) - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.DecisionStrategy.DeepCopyInto(&out.DecisionStrategy) - 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.DecisionGroups != nil { - in, out := &in.DecisionGroups, &out.DecisionGroups - *out = make([]DecisionGroupStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - 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 *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 - 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/v1beta1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.swagger_doc_generated.go deleted file mode 100644 index fa6e6862a9..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/zz_generated.swagger_doc_generated.go +++ /dev/null @@ -1,240 +0,0 @@ -package v1beta1 - -// 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_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_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_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_DecisionGroup = map[string]string{ - "": "DecisionGroup define a subset of clusters that will be added to placementDecisions with groupName label.", - "groupName": "Group name to be added as label value to the created placement Decisions labels with label key cluster.open-cluster-management.io/decision-group-name", - "groupClusterSelector": "LabelSelector to select clusters subset by label.", -} - -func (DecisionGroup) SwaggerDoc() map[string]string { - return map_DecisionGroup -} - -var map_DecisionGroupStatus = map[string]string{ - "": "Present decision groups status based on the DecisionStrategy definition.", - "decisionGroupIndex": "Present the decision group index. If there is no decision strategy defined all placement decisions will be in group index 0", - "decisionGroupName": "Decision group name that is defined in the DecisionStrategy's DecisionGroup.", - "decisions": "List of placement decisions names associated with the decision group", - "clusterCount": "Total number of clusters in the decision group. Clusters count is equal or less than the clusterPerDecisionGroups defined in the decision strategy.", -} - -func (DecisionGroupStatus) SwaggerDoc() map[string]string { - return map_DecisionGroupStatus -} - -var map_DecisionStrategy = map[string]string{ - "": "DecisionStrategy divide the created placement decision to groups and define number of clusters per decision group.", - "groupStrategy": "GroupStrategy define strategies to divide selected clusters to decision groups.", -} - -func (DecisionStrategy) SwaggerDoc() map[string]string { - return map_DecisionStrategy -} - -var map_GroupStrategy = map[string]string{ - "": "Group the created placementDecision into decision groups based on the number of clusters per decision group.", - "decisionGroups": "DecisionGroups represents a list of predefined groups to put decision results. Decision groups will be constructed based on the DecisionGroups field at first. The clusters not included in the DecisionGroups will be divided to other decision groups afterwards. Each decision group should not have the number of clusters larger than the ClustersPerDecisionGroup.", - "clustersPerDecisionGroup": "ClustersPerDecisionGroup is a specific number or percentage of the total selected clusters. The specific number will divide the placementDecisions to decisionGroups each group has max number of clusters equal to that specific number. The percentage will divide the placementDecisions to decisionGroups each group has max number of clusters based on the total num of selected clusters and percentage. ex; for a total 100 clusters selected, ClustersPerDecisionGroup equal to 20% will divide the placement decision to 5 groups each group should have 20 clusters. Default is having all clusters in a single group.\n\nThe predefined decisionGroups is expected to be a subset of the selected clusters and the number of items in each group SHOULD be less than ClustersPerDecisionGroup. Once the number of items exceeds the ClustersPerDecisionGroup, the decisionGroups will also be be divided into multiple decisionGroups with same GroupName but different GroupIndex.", -} - -func (GroupStrategy) SwaggerDoc() map[string]string { - return map_GroupStrategy -} - -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:\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\nA ManagedCluster will not be selected if no ManagedClusterSet is bound to the placement namespace. A user is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have an RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`.\n\nA slice of PlacementDecisions with the 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_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.", - "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.", - "decisionStrategy": "DecisionStrategy divide the created placement decision to groups and define number of clusters per decision group.", -} - -func (PlacementSpec) SwaggerDoc() map[string]string { - return map_PlacementSpec -} - -var map_PlacementStatus = map[string]string{ - "numberOfSelectedClusters": "NumberOfSelectedClusters represents the number of selected ManagedClusters", - "decisionGroups": "List of decision groups determined by the placement and DecisionStrategy.", - "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", - "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. 4) Spread: spread the workload evenly to topologies.", - "addOn": "When type is \"AddOn\", AddOn defines the resource name and score name.", -} - -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.", - "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_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_PlacementDecision = map[string]string{ - "": "PlacementDecision indicates a decision from a placement. PlacementDecision must have a cluster.open-cluster-management.io/placement={placement name} label to reference a certain placement.\n\nIf a placement has spec.numberOfClusters specified, the total number of decisions contained in the status.decisions of PlacementDecisions must be the same as NumberOfClusters. Otherwise, the total number of decisions must equal the number of ManagedClusters that match the placement requirements.\n\nSome of the decisions might be empty when there are not enough ManagedClusters to 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 -} - -// AUTO-GENERATED FUNCTIONS END HERE 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 deleted file mode 100644 index dd633ce744..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml +++ /dev/null @@ -1,207 +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 - preserveUnknownFields: false - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status - name: Empty - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta2 - schema: - openAPIV3Schema: - description: "ManagedClusterSet defines a group of ManagedClusters that you - can run workloads on. You can define a workload to be deployed on a ManagedClusterSet. - See the following options for the workload: - The workload can run on any - ManagedCluster in the ManagedClusterSet - The workload cannot run on any - ManagedCluster outside the ManagedClusterSet - The service exposed by the - workload can be shared in any ManagedCluster in the ManagedClusterSet \n - To assign a ManagedCluster to a certain ManagedClusterSet, add a label with - the name cluster.open-cluster-management.io/clusterset on the ManagedCluster - to refer to the ManagedClusterSet. You are not allowed to add or remove - this label on a ManagedCluster unless you have an RBAC rule to CREATE on - a virtual subresource of managedclustersets/join. To update this label, - you must have the permission on both the old and new ManagedClusterSet." - 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: - default: - clusterSelector: - selectorType: ExclusiveClusterSetLabel - description: Spec defines the attributes of the ManagedClusterSet - properties: - clusterSelector: - default: - selectorType: ExclusiveClusterSetLabel - description: ClusterSelector represents a selector of ManagedClusters - properties: - labelSelector: - description: LabelSelector define the general labelSelector which - clusterset will use to select target managedClusters - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, NotIn, - Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If - the operator is In or NotIn, the values array must - be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced - during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A - single {key,value} in the matchLabels map is equivalent - to an element of matchExpressions, whose key field is "key", - the operator is "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - selectorType: - default: ExclusiveClusterSetLabel - 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 - enum: - - ExclusiveClusterSetLabel - - LabelSelector - type: string - type: object - type: object - status: - description: Status represents the current status of the ManagedClusterSet - properties: - conditions: - description: Conditions contains the different condition statuses - for this ManagedClusterSet. - 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, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] 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 deleted file mode 100644 index cc5dfdffc8..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml +++ /dev/null @@ -1,136 +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 - preserveUnknownFields: false - scope: Namespaced - versions: - - name: v1beta2 - schema: - openAPIV3Schema: - description: ManagedClusterSetBinding projects a ManagedClusterSet into a - certain namespace. You can create a ManagedClusterSetBinding in a namespace - and bind it to a ManagedClusterSet if both have a RBAC rules to CREATE on - the virtual subresource of managedclustersets/bind. Workloads that you create - in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets - that are bound in this namespace by higher-level controllers. - 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. - 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. - minLength: 1 - type: string - type: object - status: - description: Status represents the current status of the ManagedClusterSetBinding - properties: - conditions: - description: Conditions contains the different condition statuses - for this ManagedClusterSetBinding. - 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, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/doc.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/doc.go deleted file mode 100644 index 28e6834b10..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package v1beta2 contains API Schema definitions for the cluster v1beta2 API group -// +k8s:deepcopy-gen=package,register -// +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/register.go b/vendor/open-cluster-management.io/api/cluster/v1beta2/register.go deleted file mode 100644 index ed058a6639..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/register.go +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index ec673132d1..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclusterset.go +++ /dev/null @@ -1,100 +0,0 @@ -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 you can run -// workloads on. You can define a workload to be deployed on a ManagedClusterSet. See the following options for the workload: -// - The workload can run on any ManagedCluster in the ManagedClusterSet -// - The workload cannot run on any ManagedCluster outside the ManagedClusterSet -// - The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet -// -// To assign a ManagedCluster to a certain ManagedClusterSet, add a label with the name cluster.open-cluster-management.io/clusterset -// on the ManagedCluster to refer to the ManagedClusterSet. You are not -// allowed to add or remove this label on a ManagedCluster unless you have an -// RBAC rule to CREATE on a virtual subresource of managedclustersets/join. -// To update this label, you 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 deleted file mode 100644 index 8166386d07..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/types_managedclustersetbinding.go +++ /dev/null @@ -1,64 +0,0 @@ -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. -// You can create a ManagedClusterSetBinding in a namespace and bind it to a -// ManagedClusterSet if both have a RBAC rules to CREATE on the virtual subresource of managedclustersets/bind. -// Workloads that you create in the same namespace can only be distributed to ManagedClusters -// in ManagedClusterSets that are 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 deleted file mode 100644 index 62bd2dfbee..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.deepcopy.go +++ /dev/null @@ -1,233 +0,0 @@ -//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 deleted file mode 100644 index f032f0c6f7..0000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/zz_generated.swagger_doc_generated.go +++ /dev/null @@ -1,100 +0,0 @@ -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 you can run workloads on. You can define a workload to be deployed on a ManagedClusterSet. See the following options for the workload: - The workload can run on any ManagedCluster in the ManagedClusterSet - The workload cannot run on any ManagedCluster outside the ManagedClusterSet - The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nTo assign a ManagedCluster to a certain ManagedClusterSet, add a label with the name cluster.open-cluster-management.io/clusterset on the ManagedCluster to refer to the ManagedClusterSet. You are not allowed to add or remove this label on a ManagedCluster unless you have an RBAC rule to CREATE on a virtual subresource of managedclustersets/join. To update this label, you 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. You can create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if both have a RBAC rules to CREATE on the virtual subresource of managedclustersets/bind. Workloads that you create in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets that are 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