forked from open-cluster-management-io/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed issue open-cluster-management-io#112 - spreated types.go file
- Loading branch information
1 parent
623a2d6
commit e03f52c
Showing
2 changed files
with
49 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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",shortName={"mclsetbinding","mclsetbindings"} | ||
// +kubebuilder:storageversion | ||
|
||
// ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. | ||
// User is able to create a ManagedClusterSetBinding in a namespace and bind it to a | ||
// ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of | ||
// managedclustersets/bind. Workloads created in the same namespace can only be | ||
// distributed to ManagedClusters in ManagedClusterSets bound in this namespace by | ||
// higher level controllers. | ||
type ManagedClusterSetBinding struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec defines the attributes of ManagedClusterSetBinding. | ||
Spec ManagedClusterSetBindingSpec `json:"spec"` | ||
} | ||
|
||
// ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding. | ||
type ManagedClusterSetBindingSpec struct { | ||
// ClusterSet is the name of the ManagedClusterSet to bind. It must match the | ||
// instance name of the ManagedClusterSetBinding and cannot change once created. | ||
// User is allowed to set this field if they have an RBAC rule to CREATE on the | ||
// virtual subresource of managedclustersets/bind. | ||
// +kubebuilder:validation:MinLength=1 | ||
ClusterSet string `json:"clusterSet"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding. | ||
type ManagedClusterSetBindingList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// Standard list metadata. | ||
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds | ||
// +optional | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
// Items is a list of ManagedClusterSetBinding. | ||
Items []ManagedClusterSetBinding `json:"items"` | ||
} |