Skip to content

Commit

Permalink
fixed issue open-cluster-management-io#112 - spreated types.go file
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan-pinto committed Dec 20, 2021
1 parent 623a2d6 commit e03f52c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 44 deletions.
45 changes: 1 addition & 44 deletions cluster/v1beta1/types.go → cluster/v1beta1/placement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,47 +64,4 @@ type ManagedClusterSetList struct {

// Items is a list of ManagedClusterSet.
Items []ManagedClusterSet `json:"items"`
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:scope="Namespaced",shortName={"mclsetbinding","mclsetbindings"}
// +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"`
}
}
48 changes: 48 additions & 0 deletions cluster/v1beta1/placementbinding_types.go
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"`
}

0 comments on commit e03f52c

Please sign in to comment.