Merge pull request #65 from skeeey/add-clusterset-crds

add clusterset crds
This commit is contained in:
OpenShift Merge Robot
2020-08-25 04:52:40 -04:00
committed by GitHub
23 changed files with 1679 additions and 55 deletions

2
go.mod
View File

@@ -7,7 +7,7 @@ require (
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1
github.com/open-cluster-management/api v0.0.0-20200806152638-5caae08712f5
github.com/open-cluster-management/api v0.0.0-20200824150602-69fc6a00e4f8
github.com/openshift/api v0.0.0-20200521101457-60c476765272
github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc
github.com/openshift/library-go v0.0.0-20200617154932-eaf8c138def4

4
go.sum
View File

@@ -310,8 +310,8 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.8.1 h1:C5Dqfs/LeauYDX0jJXIe2SWmwCbGzx9yF8C8xy3Lh34=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/open-cluster-management/api v0.0.0-20200806152638-5caae08712f5 h1:N9FdbViKsIDcd6Ak4LOlk3U1d7RQDA6imBeMzilUN4E=
github.com/open-cluster-management/api v0.0.0-20200806152638-5caae08712f5/go.mod h1:+vUECYB7WkfCb52r0J7rxgD1mseSGAqGi8rTLLRcbgw=
github.com/open-cluster-management/api v0.0.0-20200824150602-69fc6a00e4f8 h1:pzQmanam3DNm/GlDNf4yJzdLOFPd7SgxQqipXz/P0nk=
github.com/open-cluster-management/api v0.0.0-20200824150602-69fc6a00e4f8/go.mod h1:+vUECYB7WkfCb52r0J7rxgD1mseSGAqGi8rTLLRcbgw=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=

View File

@@ -5,6 +5,7 @@ set -o nounset
set -o pipefail
HUB_CRD_FILES="./vendor/github.com/open-cluster-management/api/cluster/v1/*.crd.yaml
./vendor/github.com/open-cluster-management/api/cluster/v1alpha1/*.crd.yaml
./vendor/github.com/open-cluster-management/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml
"

View File

@@ -0,0 +1,149 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: managedclustersets.cluster.open-cluster-management.io
spec:
group: cluster.open-cluster-management.io
names:
kind: ManagedClusterSet
listKind: ManagedClusterSetList
plural: managedclustersets
singular: managedclusterset
scope: Cluster
subresources:
status: {}
preserveUnknownFields: false
validation:
openAPIV3Schema:
description: "ManagedClusterSet defines a group of ManagedClusters that user's
workload can run on. A workload can be defined to deployed on a ManagedClusterSet,
which mean: \n 1. The workload can run on any ManagedCluster in the ManagedClusterSet
2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet
3. The service exposed by the workload can be shared in any ManagedCluster
in the ManagedClusterSet"
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the attributes of the desired ManagedClusters
type: object
properties:
clusterSelectors:
description: ClusterSelectors represents a slice of selectors to select
ManagedClusters If empty, the ManagedClusterSet will include all ManagedClusters
If more than one ClusterSelector are specified in the slice, OR operation
will be used between them.
type: array
items:
description: ClusterSelector represents a selector of ManagedClusters
ClusterNames and LabelSelector are mutually exclusive. They cannot
be set at the same time. If none of them is set, all ManagedClusters
will be selected
type: object
properties:
clusterNames:
description: ClusterNames represents a list of cluster name
type: array
items:
type: string
labelSelector:
description: LabelSelector represents a label selector to select
cluster by label
type: object
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
type: array
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
type: object
required:
- key
- operator
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
type: array
items:
type: string
matchLabels:
description: matchLabels is a map of {key,value} pairs. A
single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is "key",
the operator is "In", and the values array contains only
"value". The requirements are ANDed.
type: object
additionalProperties:
type: string
status:
description: Status represents the current status of the ManagedClusterSet
type: object
properties:
conditions:
description: Conditions contains the different condition statuses for
this ManagedClusterSet.
type: array
items:
description: StatusCondition contains condition information for a
ManagedClusterSet.
type: object
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
changed from one status to another.
type: string
format: date-time
message:
description: Message is a human-readable message indicating details
about the last status change.
type: string
reason:
description: Reason is a (brief) reason for the condition's last
status change.
type: string
status:
description: Status is the status of the condition. One of True,
False, Unknown.
type: string
type:
description: Type is the type of the ManagedClusterSet condition.
type: string
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,56 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: managedclustersetbindings.cluster.open-cluster-management.io
spec:
group: cluster.open-cluster-management.io
names:
kind: ManagedClusterSetBinding
listKind: ManagedClusterSetBindingList
plural: managedclustersetbindings
singular: managedclustersetbinding
scope: Namespaced
preserveUnknownFields: false
validation:
openAPIV3Schema:
description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain
namespace. User is able to create a ManagedClusterSetBinding in a namespace
and bind it to a ManagedClusterSet if they have an RBAC rule to GET on the
virtual subresource of managedclustersets/bind. Workloads created in the same
namespace can only be distributed to ManagedClusters in ManagedClustersets
bound in this namespace by higher level controllers.
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the attributes of ManagedClusterSetBinding.
type: object
properties:
clusterSet:
description: ClusterSet is the name of the ManagedClusterSet to bind.
User is allowed to set or update this field if they have an RBAC rule
to GET on the virtual subresource of managedclustersets/bind.
type: string
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,7 +1,9 @@
// Code generated for package bindata by go-bindata DO NOT EDIT. (@generated)
// sources:
// manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml
// manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml
// manifests/cluster-manager/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml
// manifests/cluster-manager/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml
// manifests/cluster-manager/cluster-manager-namespace.yaml
// manifests/cluster-manager/cluster-manager-registration-clusterrole.yaml
// manifests/cluster-manager/cluster-manager-registration-clusterrolebinding.yaml
@@ -258,6 +260,172 @@ func manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclust
return a, nil
}
var _manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYaml = []byte(`apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: managedclustersets.cluster.open-cluster-management.io
spec:
group: cluster.open-cluster-management.io
names:
kind: ManagedClusterSet
listKind: ManagedClusterSetList
plural: managedclustersets
singular: managedclusterset
scope: Cluster
subresources:
status: {}
preserveUnknownFields: false
validation:
openAPIV3Schema:
description: "ManagedClusterSet defines a group of ManagedClusters that user's
workload can run on. A workload can be defined to deployed on a ManagedClusterSet,
which mean: \n 1. The workload can run on any ManagedCluster in the ManagedClusterSet
2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet
3. The service exposed by the workload can be shared in any ManagedCluster
in the ManagedClusterSet"
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the attributes of the desired ManagedClusters
type: object
properties:
clusterSelectors:
description: ClusterSelectors represents a slice of selectors to select
ManagedClusters If empty, the ManagedClusterSet will include all ManagedClusters
If more than one ClusterSelector are specified in the slice, OR operation
will be used between them.
type: array
items:
description: ClusterSelector represents a selector of ManagedClusters
ClusterNames and LabelSelector are mutually exclusive. They cannot
be set at the same time. If none of them is set, all ManagedClusters
will be selected
type: object
properties:
clusterNames:
description: ClusterNames represents a list of cluster name
type: array
items:
type: string
labelSelector:
description: LabelSelector represents a label selector to select
cluster by label
type: object
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
type: array
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
type: object
required:
- key
- operator
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
type: array
items:
type: string
matchLabels:
description: matchLabels is a map of {key,value} pairs. A
single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is "key",
the operator is "In", and the values array contains only
"value". The requirements are ANDed.
type: object
additionalProperties:
type: string
status:
description: Status represents the current status of the ManagedClusterSet
type: object
properties:
conditions:
description: Conditions contains the different condition statuses for
this ManagedClusterSet.
type: array
items:
description: StatusCondition contains condition information for a
ManagedClusterSet.
type: object
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
changed from one status to another.
type: string
format: date-time
message:
description: Message is a human-readable message indicating details
about the last status change.
type: string
reason:
description: Reason is a (brief) reason for the condition's last
status change.
type: string
status:
description: Status is the status of the condition. One of True,
False, Unknown.
type: string
type:
description: Type is the type of the ManagedClusterSet condition.
type: string
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
`)
func manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYamlBytes() ([]byte, error) {
return _manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYaml, nil
}
func manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYaml() (*asset, error) {
bytes, err := manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _manifestsClusterManager0000_00_workOpenClusterManagementIo_manifestworksCrdYaml = []byte(`apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
@@ -461,6 +629,79 @@ func manifestsClusterManager0000_00_workOpenClusterManagementIo_manifestworksCrd
return a, nil
}
var _manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYaml = []byte(`apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: managedclustersetbindings.cluster.open-cluster-management.io
spec:
group: cluster.open-cluster-management.io
names:
kind: ManagedClusterSetBinding
listKind: ManagedClusterSetBindingList
plural: managedclustersetbindings
singular: managedclustersetbinding
scope: Namespaced
preserveUnknownFields: false
validation:
openAPIV3Schema:
description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain
namespace. User is able to create a ManagedClusterSetBinding in a namespace
and bind it to a ManagedClusterSet if they have an RBAC rule to GET on the
virtual subresource of managedclustersets/bind. Workloads created in the same
namespace can only be distributed to ManagedClusters in ManagedClustersets
bound in this namespace by higher level controllers.
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the attributes of ManagedClusterSetBinding.
type: object
properties:
clusterSet:
description: ClusterSet is the name of the ManagedClusterSet to bind.
User is allowed to set or update this field if they have an RBAC rule
to GET on the virtual subresource of managedclustersets/bind.
type: string
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
`)
func manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYamlBytes() ([]byte, error) {
return _manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYaml, nil
}
func manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYaml() (*asset, error) {
bytes, err := manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "manifests/cluster-manager/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _manifestsClusterManagerClusterManagerNamespaceYaml = []byte(`apiVersion: v1
kind: Namespace
metadata:
@@ -1376,30 +1617,32 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml": manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersCrdYaml,
"manifests/cluster-manager/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml": manifestsClusterManager0000_00_workOpenClusterManagementIo_manifestworksCrdYaml,
"manifests/cluster-manager/cluster-manager-namespace.yaml": manifestsClusterManagerClusterManagerNamespaceYaml,
"manifests/cluster-manager/cluster-manager-registration-clusterrole.yaml": manifestsClusterManagerClusterManagerRegistrationClusterroleYaml,
"manifests/cluster-manager/cluster-manager-registration-clusterrolebinding.yaml": manifestsClusterManagerClusterManagerRegistrationClusterrolebindingYaml,
"manifests/cluster-manager/cluster-manager-registration-deployment.yaml": manifestsClusterManagerClusterManagerRegistrationDeploymentYaml,
"manifests/cluster-manager/cluster-manager-registration-serviceaccount.yaml": manifestsClusterManagerClusterManagerRegistrationServiceaccountYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-apiservice.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookApiserviceYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-clusterrole.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookClusterroleYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-clusterrolebinding.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookClusterrolebindingYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-deployment.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookDeploymentYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-mutatingconfiguration.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookMutatingconfigurationYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-secret.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookSecretYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-service.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookServiceYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-serviceaccount.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookServiceaccountYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-validatingconfiguration.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookValidatingconfigurationYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-apiservice.yaml": manifestsClusterManagerClusterManagerWorkWebhookApiserviceYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-clusterrole.yaml": manifestsClusterManagerClusterManagerWorkWebhookClusterroleYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-clusterrolebinding.yaml": manifestsClusterManagerClusterManagerWorkWebhookClusterrolebindingYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-deployment.yaml": manifestsClusterManagerClusterManagerWorkWebhookDeploymentYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-secret.yaml": manifestsClusterManagerClusterManagerWorkWebhookSecretYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-service.yaml": manifestsClusterManagerClusterManagerWorkWebhookServiceYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-serviceaccount.yaml": manifestsClusterManagerClusterManagerWorkWebhookServiceaccountYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-validatingconfiguration.yaml": manifestsClusterManagerClusterManagerWorkWebhookValidatingconfigurationYaml,
"manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml": manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersCrdYaml,
"manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml": manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYaml,
"manifests/cluster-manager/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml": manifestsClusterManager0000_00_workOpenClusterManagementIo_manifestworksCrdYaml,
"manifests/cluster-manager/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml": manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYaml,
"manifests/cluster-manager/cluster-manager-namespace.yaml": manifestsClusterManagerClusterManagerNamespaceYaml,
"manifests/cluster-manager/cluster-manager-registration-clusterrole.yaml": manifestsClusterManagerClusterManagerRegistrationClusterroleYaml,
"manifests/cluster-manager/cluster-manager-registration-clusterrolebinding.yaml": manifestsClusterManagerClusterManagerRegistrationClusterrolebindingYaml,
"manifests/cluster-manager/cluster-manager-registration-deployment.yaml": manifestsClusterManagerClusterManagerRegistrationDeploymentYaml,
"manifests/cluster-manager/cluster-manager-registration-serviceaccount.yaml": manifestsClusterManagerClusterManagerRegistrationServiceaccountYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-apiservice.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookApiserviceYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-clusterrole.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookClusterroleYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-clusterrolebinding.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookClusterrolebindingYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-deployment.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookDeploymentYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-mutatingconfiguration.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookMutatingconfigurationYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-secret.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookSecretYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-service.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookServiceYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-serviceaccount.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookServiceaccountYaml,
"manifests/cluster-manager/cluster-manager-registration-webhook-validatingconfiguration.yaml": manifestsClusterManagerClusterManagerRegistrationWebhookValidatingconfigurationYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-apiservice.yaml": manifestsClusterManagerClusterManagerWorkWebhookApiserviceYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-clusterrole.yaml": manifestsClusterManagerClusterManagerWorkWebhookClusterroleYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-clusterrolebinding.yaml": manifestsClusterManagerClusterManagerWorkWebhookClusterrolebindingYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-deployment.yaml": manifestsClusterManagerClusterManagerWorkWebhookDeploymentYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-secret.yaml": manifestsClusterManagerClusterManagerWorkWebhookSecretYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-service.yaml": manifestsClusterManagerClusterManagerWorkWebhookServiceYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-serviceaccount.yaml": manifestsClusterManagerClusterManagerWorkWebhookServiceaccountYaml,
"manifests/cluster-manager/cluster-manager-work-webhook-validatingconfiguration.yaml": manifestsClusterManagerClusterManagerWorkWebhookValidatingconfigurationYaml,
}
// AssetDir returns the file names below a certain
@@ -1445,30 +1688,32 @@ type bintree struct {
var _bintree = &bintree{nil, map[string]*bintree{
"manifests": {nil, map[string]*bintree{
"cluster-manager": {nil, map[string]*bintree{
"0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml": {manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersCrdYaml, map[string]*bintree{}},
"0000_00_work.open-cluster-management.io_manifestworks.crd.yaml": {manifestsClusterManager0000_00_workOpenClusterManagementIo_manifestworksCrdYaml, map[string]*bintree{}},
"cluster-manager-namespace.yaml": {manifestsClusterManagerClusterManagerNamespaceYaml, map[string]*bintree{}},
"cluster-manager-registration-clusterrole.yaml": {manifestsClusterManagerClusterManagerRegistrationClusterroleYaml, map[string]*bintree{}},
"cluster-manager-registration-clusterrolebinding.yaml": {manifestsClusterManagerClusterManagerRegistrationClusterrolebindingYaml, map[string]*bintree{}},
"cluster-manager-registration-deployment.yaml": {manifestsClusterManagerClusterManagerRegistrationDeploymentYaml, map[string]*bintree{}},
"cluster-manager-registration-serviceaccount.yaml": {manifestsClusterManagerClusterManagerRegistrationServiceaccountYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-apiservice.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookApiserviceYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-clusterrole.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookClusterroleYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-clusterrolebinding.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookClusterrolebindingYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-deployment.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookDeploymentYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-mutatingconfiguration.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookMutatingconfigurationYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-secret.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookSecretYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-service.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookServiceYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-serviceaccount.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookServiceaccountYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-validatingconfiguration.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookValidatingconfigurationYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-apiservice.yaml": {manifestsClusterManagerClusterManagerWorkWebhookApiserviceYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-clusterrole.yaml": {manifestsClusterManagerClusterManagerWorkWebhookClusterroleYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-clusterrolebinding.yaml": {manifestsClusterManagerClusterManagerWorkWebhookClusterrolebindingYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-deployment.yaml": {manifestsClusterManagerClusterManagerWorkWebhookDeploymentYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-secret.yaml": {manifestsClusterManagerClusterManagerWorkWebhookSecretYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-service.yaml": {manifestsClusterManagerClusterManagerWorkWebhookServiceYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-serviceaccount.yaml": {manifestsClusterManagerClusterManagerWorkWebhookServiceaccountYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-validatingconfiguration.yaml": {manifestsClusterManagerClusterManagerWorkWebhookValidatingconfigurationYaml, map[string]*bintree{}},
"0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml": {manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersCrdYaml, map[string]*bintree{}},
"0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml": {manifestsClusterManager0000_00_clustersOpenClusterManagementIo_managedclustersetsCrdYaml, map[string]*bintree{}},
"0000_00_work.open-cluster-management.io_manifestworks.crd.yaml": {manifestsClusterManager0000_00_workOpenClusterManagementIo_manifestworksCrdYaml, map[string]*bintree{}},
"0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml": {manifestsClusterManager0000_01_clustersOpenClusterManagementIo_managedclustersetbindingsCrdYaml, map[string]*bintree{}},
"cluster-manager-namespace.yaml": {manifestsClusterManagerClusterManagerNamespaceYaml, map[string]*bintree{}},
"cluster-manager-registration-clusterrole.yaml": {manifestsClusterManagerClusterManagerRegistrationClusterroleYaml, map[string]*bintree{}},
"cluster-manager-registration-clusterrolebinding.yaml": {manifestsClusterManagerClusterManagerRegistrationClusterrolebindingYaml, map[string]*bintree{}},
"cluster-manager-registration-deployment.yaml": {manifestsClusterManagerClusterManagerRegistrationDeploymentYaml, map[string]*bintree{}},
"cluster-manager-registration-serviceaccount.yaml": {manifestsClusterManagerClusterManagerRegistrationServiceaccountYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-apiservice.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookApiserviceYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-clusterrole.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookClusterroleYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-clusterrolebinding.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookClusterrolebindingYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-deployment.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookDeploymentYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-mutatingconfiguration.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookMutatingconfigurationYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-secret.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookSecretYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-service.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookServiceYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-serviceaccount.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookServiceaccountYaml, map[string]*bintree{}},
"cluster-manager-registration-webhook-validatingconfiguration.yaml": {manifestsClusterManagerClusterManagerRegistrationWebhookValidatingconfigurationYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-apiservice.yaml": {manifestsClusterManagerClusterManagerWorkWebhookApiserviceYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-clusterrole.yaml": {manifestsClusterManagerClusterManagerWorkWebhookClusterroleYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-clusterrolebinding.yaml": {manifestsClusterManagerClusterManagerWorkWebhookClusterrolebindingYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-deployment.yaml": {manifestsClusterManagerClusterManagerWorkWebhookDeploymentYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-secret.yaml": {manifestsClusterManagerClusterManagerWorkWebhookSecretYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-service.yaml": {manifestsClusterManagerClusterManagerWorkWebhookServiceYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-serviceaccount.yaml": {manifestsClusterManagerClusterManagerWorkWebhookServiceaccountYaml, map[string]*bintree{}},
"cluster-manager-work-webhook-validatingconfiguration.yaml": {manifestsClusterManagerClusterManagerWorkWebhookValidatingconfigurationYaml, map[string]*bintree{}},
}},
}},
}}

View File

@@ -39,7 +39,9 @@ var (
}
staticResourceFiles = []string{
"manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml",
"manifests/cluster-manager/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml",
"manifests/cluster-manager/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml",
"manifests/cluster-manager/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml",
"manifests/cluster-manager/cluster-manager-registration-clusterrole.yaml",
"manifests/cluster-manager/cluster-manager-registration-clusterrolebinding.yaml",
"manifests/cluster-manager/cluster-manager-namespace.yaml",

View File

@@ -138,7 +138,7 @@ func TestSyncDeploy(t *testing.T) {
}
}
// Check if resources are created as expected
testinghelper.AssertEqualNumber(t, len(createCRDObjects), 2)
testinghelper.AssertEqualNumber(t, len(createCRDObjects), 4)
createAPIServiceObjects := []runtime.Object{}
apiServiceActions := controller.apiRegistrationClient.Actions()
@@ -191,7 +191,7 @@ func TestSyncDelete(t *testing.T) {
}
}
// Check if resources are created as expected
testinghelper.AssertEqualNumber(t, len(deleteCRDActions), 4)
testinghelper.AssertEqualNumber(t, len(deleteCRDActions), 6)
deleteAPIServiceActions := []clienttesting.DeleteActionImpl{}
apiServiceActions := controller.apiRegistrationClient.Actions()

View File

@@ -6,6 +6,7 @@ import (
"fmt"
clusterv1 "github.com/open-cluster-management/api/client/cluster/clientset/versioned/typed/cluster/v1"
clusterv1alpha1 "github.com/open-cluster-management/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
@@ -14,13 +15,15 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
ClusterV1() clusterv1.ClusterV1Interface
ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
clusterV1 *clusterv1.ClusterV1Client
clusterV1 *clusterv1.ClusterV1Client
clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client
}
// ClusterV1 retrieves the ClusterV1Client
@@ -28,6 +31,11 @@ func (c *Clientset) ClusterV1() clusterv1.ClusterV1Interface {
return c.clusterV1
}
// ClusterV1alpha1 retrieves the ClusterV1alpha1Client
func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface {
return c.clusterV1alpha1
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
@@ -53,6 +61,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.clusterV1alpha1, err = clusterv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
@@ -66,6 +78,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.clusterV1 = clusterv1.NewForConfigOrDie(c)
cs.clusterV1alpha1 = clusterv1alpha1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@@ -75,6 +88,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.clusterV1 = clusterv1.New(c)
cs.clusterV1alpha1 = clusterv1alpha1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs

View File

@@ -4,6 +4,7 @@ package scheme
import (
clusterv1 "github.com/open-cluster-management/api/cluster/v1"
clusterv1alpha1 "github.com/open-cluster-management/api/cluster/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -16,6 +17,7 @@ var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
clusterv1.AddToScheme,
clusterv1alpha1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@@ -0,0 +1,78 @@
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"github.com/open-cluster-management/api/client/cluster/clientset/versioned/scheme"
v1alpha1 "github.com/open-cluster-management/api/cluster/v1alpha1"
rest "k8s.io/client-go/rest"
)
type ClusterV1alpha1Interface interface {
RESTClient() rest.Interface
ManagedClusterSetsGetter
ManagedClusterSetBindingsGetter
}
// 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) ManagedClusterSets() ManagedClusterSetInterface {
return newManagedClusterSets(c)
}
func (c *ClusterV1alpha1Client) ManagedClusterSetBindings(namespace string) ManagedClusterSetBindingInterface {
return newManagedClusterSetBindings(c, namespace)
}
// NewForConfig creates a new ClusterV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
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
}

View File

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

View File

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

View File

@@ -0,0 +1,168 @@
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/open-cluster-management/api/client/cluster/clientset/versioned/scheme"
v1alpha1 "github.com/open-cluster-management/api/cluster/v1alpha1"
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"
)
// 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 *v1alpha1.ManagedClusterSet, opts v1.CreateOptions) (*v1alpha1.ManagedClusterSet, error)
Update(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterSet, error)
UpdateStatus(ctx context.Context, managedClusterSet *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterSet, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ManagedClusterSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ManagedClusterSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterSet, err error)
ManagedClusterSetExpansion
}
// managedClusterSets implements ManagedClusterSetInterface
type managedClusterSets struct {
client rest.Interface
}
// newManagedClusterSets returns a ManagedClusterSets
func newManagedClusterSets(c *ClusterV1alpha1Client) *managedClusterSets {
return &managedClusterSets{
client: c.RESTClient(),
}
}
// Get takes name of the managedClusterSet, and returns the corresponding managedClusterSet object, and an error if there is any.
func (c *managedClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManagedClusterSet, err error) {
result = &v1alpha1.ManagedClusterSet{}
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 *v1alpha1.ManagedClusterSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.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 *v1alpha1.ManagedClusterSet, opts v1.CreateOptions) (result *v1alpha1.ManagedClusterSet, err error) {
result = &v1alpha1.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 *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterSet, err error) {
result = &v1alpha1.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 *v1alpha1.ManagedClusterSet, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterSet, err error) {
result = &v1alpha1.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 *v1alpha1.ManagedClusterSet, err error) {
result = &v1alpha1.ManagedClusterSet{}
err = c.client.Patch(pt).
Resource("managedclustersets").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,162 @@
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/open-cluster-management/api/client/cluster/clientset/versioned/scheme"
v1alpha1 "github.com/open-cluster-management/api/cluster/v1alpha1"
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"
)
// 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 *v1alpha1.ManagedClusterSetBinding, opts v1.CreateOptions) (*v1alpha1.ManagedClusterSetBinding, error)
Update(ctx context.Context, managedClusterSetBinding *v1alpha1.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterSetBinding, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ManagedClusterSetBinding, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ManagedClusterSetBindingList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterSetBinding, err error)
ManagedClusterSetBindingExpansion
}
// managedClusterSetBindings implements ManagedClusterSetBindingInterface
type managedClusterSetBindings struct {
client rest.Interface
ns string
}
// newManagedClusterSetBindings returns a ManagedClusterSetBindings
func newManagedClusterSetBindings(c *ClusterV1alpha1Client, 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 *v1alpha1.ManagedClusterSetBinding, err error) {
result = &v1alpha1.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 *v1alpha1.ManagedClusterSetBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.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 *v1alpha1.ManagedClusterSetBinding, opts v1.CreateOptions) (result *v1alpha1.ManagedClusterSetBinding, err error) {
result = &v1alpha1.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 *v1alpha1.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterSetBinding, err error) {
result = &v1alpha1.ManagedClusterSetBinding{}
err = c.client.Put().
Namespace(c.ns).
Resource("managedclustersetbindings").
Name(managedClusterSetBinding.Name).
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 *v1alpha1.ManagedClusterSetBinding, err error) {
result = &v1alpha1.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
}

View File

@@ -0,0 +1,149 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: managedclustersets.cluster.open-cluster-management.io
spec:
group: cluster.open-cluster-management.io
names:
kind: ManagedClusterSet
listKind: ManagedClusterSetList
plural: managedclustersets
singular: managedclusterset
scope: Cluster
subresources:
status: {}
preserveUnknownFields: false
validation:
openAPIV3Schema:
description: "ManagedClusterSet defines a group of ManagedClusters that user's
workload can run on. A workload can be defined to deployed on a ManagedClusterSet,
which mean: \n 1. The workload can run on any ManagedCluster in the ManagedClusterSet
2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet
3. The service exposed by the workload can be shared in any ManagedCluster
in the ManagedClusterSet"
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the attributes of the desired ManagedClusters
type: object
properties:
clusterSelectors:
description: ClusterSelectors represents a slice of selectors to select
ManagedClusters If empty, the ManagedClusterSet will include all ManagedClusters
If more than one ClusterSelector are specified in the slice, OR operation
will be used between them.
type: array
items:
description: ClusterSelector represents a selector of ManagedClusters
ClusterNames and LabelSelector are mutually exclusive. They cannot
be set at the same time. If none of them is set, all ManagedClusters
will be selected
type: object
properties:
clusterNames:
description: ClusterNames represents a list of cluster name
type: array
items:
type: string
labelSelector:
description: LabelSelector represents a label selector to select
cluster by label
type: object
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
type: array
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
type: object
required:
- key
- operator
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
type: array
items:
type: string
matchLabels:
description: matchLabels is a map of {key,value} pairs. A
single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is "key",
the operator is "In", and the values array contains only
"value". The requirements are ANDed.
type: object
additionalProperties:
type: string
status:
description: Status represents the current status of the ManagedClusterSet
type: object
properties:
conditions:
description: Conditions contains the different condition statuses for
this ManagedClusterSet.
type: array
items:
description: StatusCondition contains condition information for a
ManagedClusterSet.
type: object
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
changed from one status to another.
type: string
format: date-time
message:
description: Message is a human-readable message indicating details
about the last status change.
type: string
reason:
description: Reason is a (brief) reason for the condition's last
status change.
type: string
status:
description: Status is the status of the condition. One of True,
False, Unknown.
type: string
type:
description: Type is the type of the ManagedClusterSet condition.
type: string
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,56 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: managedclustersetbindings.cluster.open-cluster-management.io
spec:
group: cluster.open-cluster-management.io
names:
kind: ManagedClusterSetBinding
listKind: ManagedClusterSetBindingList
plural: managedclustersetbindings
singular: managedclustersetbinding
scope: Namespaced
preserveUnknownFields: false
validation:
openAPIV3Schema:
description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain
namespace. User is able to create a ManagedClusterSetBinding in a namespace
and bind it to a ManagedClusterSet if they have an RBAC rule to GET on the
virtual subresource of managedclustersets/bind. Workloads created in the same
namespace can only be distributed to ManagedClusters in ManagedClustersets
bound in this namespace by higher level controllers.
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the attributes of ManagedClusterSetBinding.
type: object
properties:
clusterSet:
description: ClusterSet is the name of the ManagedClusterSet to bind.
User is allowed to set or update this field if they have an RBAC rule
to GET on the virtual subresource of managedclustersets/bind.
type: string
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,9 @@
// Package v1alpha1 contains API Schema definitions for the cluster v1alpha1 API group
// +k8s:deepcopy-gen=package,register
// +k8s:conversion-gen=github.com/open-cluster-management/api/cluster
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-gen=true
// +kubebuilder:validation:Optional
// +groupName=cluster.open-cluster-management.io
package v1alpha1

View File

@@ -0,0 +1,40 @@
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,
&ManagedClusterSet{},
&ManagedClusterSetList{},
&ManagedClusterSetBinding{},
&ManagedClusterSetBindingList{},
)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
}

View File

@@ -0,0 +1,141 @@
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:subresource:status
// +kubebuilder:resource:scope="Cluster"
// ManagedClusterSet defines a group of ManagedClusters that user's workload can run on.
// A workload can be defined to deployed on a ManagedClusterSet, which mean:
//
// 1. The workload can run on any ManagedCluster in the ManagedClusterSet
// 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet
// 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet
type ManagedClusterSet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the attributes of the desired ManagedClusters
Spec ManagedClusterSetSpec `json:"spec"`
// Status represents the current status of the ManagedClusterSet
// +optional
Status ManagedClusterSetStatus `json:"status,omitempty"`
}
// ManagedClusterSetSpec describes the attributes of the desired ManagedClusters
type ManagedClusterSetSpec struct {
// ClusterSelectors represents a slice of selectors to select ManagedClusters
// If empty, the ManagedClusterSet will include all ManagedClusters
// If more than one ClusterSelector are specified in the slice, OR operation
// will be used between them.
// +optional
ClusterSelectors []ClusterSelector `json:"clusterSelectors,omitempty"`
}
// ClusterSelector represents a selector of ManagedClusters
// ClusterNames and LabelSelector are mutually exclusive. They cannot be set at the
// same time. If none of them is set, all ManagedClusters will be selected
type ClusterSelector struct {
// ClusterNames represents a list of cluster name
// +optional
ClusterNames []string `json:"clusterNames,omitempty"`
// LabelSelector represents a label selector to select cluster by label
// +optional
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}
// ManagedClusterSetStatus represents the current status of the ManagedClusterSet.
type ManagedClusterSetStatus struct {
// Conditions contains the different condition statuses for this ManagedClusterSet.
Conditions []StatusCondition `json:"conditions"`
}
// StatusCondition contains condition information for a ManagedClusterSet.
type StatusCondition struct {
// Type is the type of the ManagedClusterSet condition.
// +required
Type string `json:"type"`
// Status is the status of the condition. One of True, False, Unknown.
// +required
Status metav1.ConditionStatus `json:"status"`
// LastTransitionTime is the last time the condition changed from one status to another.
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
// Reason is a (brief) reason for the condition's last status change.
// +required
Reason string `json:"reason"`
// Message is a human-readable message indicating details about the last status change.
// +required
Message string `json:"message"`
}
const (
// ManagedClusterSetConditionEmpty means no ManagedCluster is included in the
// ManagedClusterSet.
ManagedClusterSetConditionEmpty string = "ClusterSetEmpty"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ManagedClusterSetList is a collection of ManagedClusterSet.
type ManagedClusterSetList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of ManagedClusterSet.
Items []ManagedClusterSet `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:scope="Namespaced"
// ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace.
// User is able to create a ManagedClusterSetBinding in a namespace and bind it to a
// ManagedClusterSet if they have an RBAC rule to GET on the virtual subresource of
// managedclustersets/bind. Workloads created in the same namespace can only be
// distributed to ManagedClusters in ManagedClustersets bound in this namespace by
// higher level controllers.
type ManagedClusterSetBinding struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the attributes of ManagedClusterSetBinding.
Spec ManagedClusterSetBindingSpec `json:"spec"`
}
// ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding.
type ManagedClusterSetBindingSpec struct {
// ClusterSet is the name of the ManagedClusterSet to bind. User is allowed
// to set or update this field if they have an RBAC rule to GET on the
// virtual subresource of managedclustersets/bind.
ClusterSet string `json:"clusterSet"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding.
type ManagedClusterSetBindingList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of ManagedClusterSetBinding.
Items []ManagedClusterSetBinding `json:"items"`
}

View File

@@ -0,0 +1,236 @@
// +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 *ClusterSelector) DeepCopyInto(out *ClusterSelector) {
*out = *in
if in.ClusterNames != nil {
in, out := &in.ClusterNames, &out.ClusterNames
*out = make([]string, len(*in))
copy(*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 ClusterSelector.
func (in *ClusterSelector) DeepCopy() *ClusterSelector {
if in == nil {
return nil
}
out := new(ClusterSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManagedClusterSet) DeepCopyInto(out *ManagedClusterSet) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
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
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBinding.
func (in *ManagedClusterSetBinding) DeepCopy() *ManagedClusterSetBinding {
if in == nil {
return nil
}
out := new(ManagedClusterSetBinding)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ManagedClusterSetBinding) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManagedClusterSetBindingList) DeepCopyInto(out *ManagedClusterSetBindingList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ManagedClusterSetBinding, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBindingList.
func (in *ManagedClusterSetBindingList) DeepCopy() *ManagedClusterSetBindingList {
if in == nil {
return nil
}
out := new(ManagedClusterSetBindingList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ManagedClusterSetBindingList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManagedClusterSetBindingSpec) DeepCopyInto(out *ManagedClusterSetBindingSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetBindingSpec.
func (in *ManagedClusterSetBindingSpec) DeepCopy() *ManagedClusterSetBindingSpec {
if in == nil {
return nil
}
out := new(ManagedClusterSetBindingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManagedClusterSetList) DeepCopyInto(out *ManagedClusterSetList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ManagedClusterSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetList.
func (in *ManagedClusterSetList) DeepCopy() *ManagedClusterSetList {
if in == nil {
return nil
}
out := new(ManagedClusterSetList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ManagedClusterSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManagedClusterSetSpec) DeepCopyInto(out *ManagedClusterSetSpec) {
*out = *in
if in.ClusterSelectors != nil {
in, out := &in.ClusterSelectors, &out.ClusterSelectors
*out = make([]ClusterSelector, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
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([]StatusCondition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSetStatus.
func (in *ManagedClusterSetStatus) DeepCopy() *ManagedClusterSetStatus {
if in == nil {
return nil
}
out := new(ManagedClusterSetStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StatusCondition) DeepCopyInto(out *StatusCondition) {
*out = *in
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusCondition.
func (in *StatusCondition) DeepCopy() *StatusCondition {
if in == nil {
return nil
}
out := new(StatusCondition)
in.DeepCopyInto(out)
return out
}

View File

@@ -0,0 +1,103 @@
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_ClusterSelector = map[string]string{
"": "ClusterSelector represents a selector of ManagedClusters ClusterNames and LabelSelector are mutually exclusive. They cannot be set at the same time. If none of them is set, all ManagedClusters will be selected",
"clusterNames": "ClusterNames represents a list of cluster name",
"labelSelector": "LabelSelector represents a label selector to select cluster by label",
}
func (ClusterSelector) SwaggerDoc() map[string]string {
return map_ClusterSelector
}
var map_ManagedClusterSet = map[string]string{
"": "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean:\n\n1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet",
"spec": "Spec defines the attributes of the desired ManagedClusters",
"status": "Status represents the current status of the ManagedClusterSet",
}
func (ManagedClusterSet) SwaggerDoc() map[string]string {
return map_ManagedClusterSet
}
var map_ManagedClusterSetBinding = map[string]string{
"": "ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to GET on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClustersets bound in this namespace by higher level controllers.",
"spec": "Spec defines the attributes of ManagedClusterSetBinding.",
}
func (ManagedClusterSetBinding) SwaggerDoc() map[string]string {
return map_ManagedClusterSetBinding
}
var map_ManagedClusterSetBindingList = map[string]string{
"": "ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding.",
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"items": "Items is a list of ManagedClusterSetBinding.",
}
func (ManagedClusterSetBindingList) SwaggerDoc() map[string]string {
return map_ManagedClusterSetBindingList
}
var map_ManagedClusterSetBindingSpec = map[string]string{
"": "ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding.",
"clusterSet": "ClusterSet is the name of the ManagedClusterSet to bind. User is allowed to set or update this field if they have an RBAC rule to GET on the virtual subresource of managedclustersets/bind.",
}
func (ManagedClusterSetBindingSpec) SwaggerDoc() map[string]string {
return map_ManagedClusterSetBindingSpec
}
var map_ManagedClusterSetList = map[string]string{
"": "ManagedClusterSetList is a collection of ManagedClusterSet.",
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"items": "Items is a list of ManagedClusterSet.",
}
func (ManagedClusterSetList) SwaggerDoc() map[string]string {
return map_ManagedClusterSetList
}
var map_ManagedClusterSetSpec = map[string]string{
"": "ManagedClusterSetSpec describes the attributes of the desired ManagedClusters",
"clusterSelectors": "ClusterSelectors represents a slice of selectors to select ManagedClusters If empty, the ManagedClusterSet will include all ManagedClusters If more than one ClusterSelector are specified in the slice, OR operation will be used between them.",
}
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_StatusCondition = map[string]string{
"": "StatusCondition contains condition information for a ManagedClusterSet.",
"type": "Type is the type of the ManagedClusterSet condition.",
"status": "Status is the status of the condition. One of True, False, Unknown.",
"lastTransitionTime": "LastTransitionTime is the last time the condition changed from one status to another.",
"reason": "Reason is a (brief) reason for the condition's last status change.",
"message": "Message is a human-readable message indicating details about the last status change.",
}
func (StatusCondition) SwaggerDoc() map[string]string {
return map_StatusCondition
}
// AUTO-GENERATED FUNCTIONS END HERE

4
vendor/modules.txt vendored
View File

@@ -133,10 +133,11 @@ github.com/onsi/gomega/matchers/support/goraph/edge
github.com/onsi/gomega/matchers/support/goraph/node
github.com/onsi/gomega/matchers/support/goraph/util
github.com/onsi/gomega/types
# github.com/open-cluster-management/api v0.0.0-20200806152638-5caae08712f5
# github.com/open-cluster-management/api v0.0.0-20200824150602-69fc6a00e4f8
github.com/open-cluster-management/api/client/cluster/clientset/versioned
github.com/open-cluster-management/api/client/cluster/clientset/versioned/scheme
github.com/open-cluster-management/api/client/cluster/clientset/versioned/typed/cluster/v1
github.com/open-cluster-management/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1
github.com/open-cluster-management/api/client/operator/clientset/versioned
github.com/open-cluster-management/api/client/operator/clientset/versioned/fake
github.com/open-cluster-management/api/client/operator/clientset/versioned/scheme
@@ -151,6 +152,7 @@ github.com/open-cluster-management/api/client/work/clientset/versioned
github.com/open-cluster-management/api/client/work/clientset/versioned/scheme
github.com/open-cluster-management/api/client/work/clientset/versioned/typed/work/v1
github.com/open-cluster-management/api/cluster/v1
github.com/open-cluster-management/api/cluster/v1alpha1
github.com/open-cluster-management/api/operator/v1
github.com/open-cluster-management/api/work/v1
# github.com/openshift/api v0.0.0-20200521101457-60c476765272