Documentation ¶
Overview ¶
Package v1alpha1 contains types required for v1alpha1 +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=prism.oam.dev
Index ¶
- Constants
- Variables
- func AddClusterFlags(set *pflag.FlagSet)
- func IsInvalidClusterSecretError(err error) bool
- func IsInvalidManagedClusterError(err error) bool
- func NewEmptyCredentialTypeClusterSecretError() error
- func NewEmptyEndpointClusterSecretError() error
- func NewInvalidManagedClusterError() error
- type Cluster
- func (in *Cluster) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)
- func (in *Cluster) DeepCopy() *Cluster
- func (in *Cluster) DeepCopyInto(out *Cluster)
- func (in *Cluster) DeepCopyObject() runtime.Object
- func (in *Cluster) Destroy()
- func (in *Cluster) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)
- func (in *Cluster) GetFullName() string
- func (in *Cluster) GetGroupVersionResource() schema.GroupVersionResource
- func (in *Cluster) GetObjectMeta() *metav1.ObjectMeta
- func (in *Cluster) IsStorageVersion() bool
- func (in *Cluster) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)
- func (in *Cluster) NamespaceScoped() bool
- func (in *Cluster) New() runtime.Object
- func (in *Cluster) NewList() runtime.Object
- func (in *Cluster) ShortNames() []string
- type ClusterClient
- type ClusterList
- type ClusterSpec
Constants ¶
const ( // ClusterLocalName name for the hub cluster ClusterLocalName = "local" // CredentialTypeInternal identifies the cluster from internal kubevela system CredentialTypeInternal v1alpha1.CredentialType = "Internal" // CredentialTypeOCMManagedCluster identifies the ocm cluster CredentialTypeOCMManagedCluster v1alpha1.CredentialType = "ManagedCluster" // ClusterBlankEndpoint identifies the endpoint of a cluster as blank (not available) ClusterBlankEndpoint = "-" )
const ( // Group the group for the apiextensions Group = "prism.oam.dev" // Version the version for the v1alpha1 apiextensions Version = "v1alpha1" )
Variables ¶
var ( // AnnotationClusterAlias the annotation key for cluster alias AnnotationClusterAlias = config.MetaApiGroupName + "/cluster-alias" // LabelClusterControlPlane identifies whether the cluster is the control plane LabelClusterControlPlane = config.MetaApiGroupName + "/control-plane" )
var ( // ClusterResource resource name for Cluster ClusterResource = "clusters" // ClusterKind kind name for Cluster ClusterKind = "Cluster" // ClusterGroupResource GroupResource for Cluster ClusterGroupResource = schema.GroupResource{Group: Group, Resource: ClusterResource} // ClusterGroupVersionKind GroupVersionKind for Cluster ClusterGroupVersionKind = GroupVersion.WithKind(ClusterKind) )
var AddToScheme = func(scheme *runtime.Scheme) error { metav1.AddToGroupVersion(scheme, GroupVersion) metav1.AddToGroupVersion(scheme, ocmclusterv1.GroupVersion) scheme.AddKnownTypes(GroupVersion, &Cluster{}, &ClusterList{}, ) scheme.AddKnownTypes(ocmclusterv1.GroupVersion, &ocmclusterv1.ManagedCluster{}, &ocmclusterv1.ManagedClusterList{}, ) return nil }
AddToScheme add virtual cluster scheme
var GroupVersion = schema.GroupVersion{Group: Group, Version: Version}
GroupVersion the apiextensions v1alpha1 group version
var StorageNamespace = "vela-system"
StorageNamespace refers to the namespace of cluster secret, usually same as the core kubevela system namespace
Functions ¶
func AddClusterFlags ¶
AddClusterFlags add flags for cluster api
func IsInvalidClusterSecretError ¶
IsInvalidClusterSecretError check if an error is an invalid cluster secret error
func IsInvalidManagedClusterError ¶
IsInvalidManagedClusterError check if an error is an invalid managed cluster error
func NewEmptyCredentialTypeClusterSecretError ¶
func NewEmptyCredentialTypeClusterSecretError() error
NewEmptyCredentialTypeClusterSecretError create an invalid cluster secret error due to empty credential type
func NewEmptyEndpointClusterSecretError ¶
func NewEmptyEndpointClusterSecretError() error
NewEmptyEndpointClusterSecretError create an invalid cluster secret error due to empty endpoint
func NewInvalidManagedClusterError ¶
func NewInvalidManagedClusterError() error
NewInvalidManagedClusterError create an invalid managed cluster error
Types ¶
type Cluster ¶
type Cluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ClusterSpec `json:"spec,omitempty"` }
Cluster is an extension model for cluster underlying secrets/ManagedClusters +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func NewClusterFromManagedCluster ¶
func NewClusterFromManagedCluster(managedCluster *ocmclusterv1.ManagedCluster) (*Cluster, error)
NewClusterFromManagedCluster extract cluster from ocm managed cluster
func NewClusterFromSecret ¶
NewClusterFromSecret extract cluster from cluster secret
func (*Cluster) ConvertToTable ¶
func (in *Cluster) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)
ConvertToTable convert resource to table
func (*Cluster) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (*Cluster) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Cluster) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Cluster) Get ¶
func (in *Cluster) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)
Get finds a resource in the storage by name and returns it.
func (*Cluster) GetFullName ¶
GetFullName returns the name with alias
func (*Cluster) GetGroupVersionResource ¶
func (in *Cluster) GetGroupVersionResource() schema.GroupVersionResource
GetGroupVersionResource returns the GroupVersionResource for this resource.
func (*Cluster) GetObjectMeta ¶
func (in *Cluster) GetObjectMeta() *metav1.ObjectMeta
GetObjectMeta returns the object meta reference.
func (*Cluster) IsStorageVersion ¶
IsStorageVersion returns true if the object is also the internal version
func (*Cluster) List ¶
func (in *Cluster) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)
List selects resources in the storage which match to the selector. 'options' can be nil.
func (*Cluster) NamespaceScoped ¶
NamespaceScoped returns if the object must be in a namespace.
func (*Cluster) ShortNames ¶
ShortNames delivers a list of short names for a resource.
type ClusterClient ¶
type ClusterClient interface { Get(ctx context.Context, name string) (*Cluster, error) List(ctx context.Context, options ...client.ListOption) (*ClusterList, error) }
ClusterClient client for reading cluster information +kubebuilder:object:generate=false
func NewClusterClient ¶
func NewClusterClient(cli client.Client) ClusterClient
NewClusterClient create a client for accessing cluster
type ClusterList ¶
type ClusterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Cluster `json:"items"` }
ClusterList list for Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ClusterList) DeepCopy ¶
func (in *ClusterList) DeepCopy() *ClusterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
func (*ClusterList) DeepCopyInto ¶
func (in *ClusterList) DeepCopyInto(out *ClusterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterList) DeepCopyObject ¶
func (in *ClusterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterList) HasCluster ¶
func (in *ClusterList) HasCluster(name string) bool
HasCluster return if the cluster list contains a cluster with the specified name
type ClusterSpec ¶
type ClusterSpec struct { Alias string `json:"alias,omitempty"` Accepted bool `json:"accepted,omitempty"` Endpoint string `json:"endpoint,omitempty"` CredentialType clusterv1alpha1.CredentialType `json:"credential-type,omitempty"` }
ClusterSpec spec of cluster
func (*ClusterSpec) DeepCopy ¶
func (in *ClusterSpec) DeepCopy() *ClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (*ClusterSpec) DeepCopyInto ¶
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.