Documentation
¶
Index ¶
- Constants
- func ManifestLabel(name string, providerType ProviderType) string
- type Provider
- type ProviderList
- func (l *ProviderList) FilterByNamespace(namespace string) []Provider
- func (l *ProviderList) FilterByProviderNameAndType(provider string, providerType ProviderType) []Provider
- func (l *ProviderList) FilterByProviderNameNamespaceTypeVersion(provider, namespace string, providerType ProviderType, version string) []Provider
- func (l *ProviderList) FilterByType(providerType ProviderType) []Provider
- func (l *ProviderList) FilterCore() []Provider
- func (l *ProviderList) FilterNonCore() []Provider
- type ProviderType
Constants ¶
const ( // ClusterctlLabel is applied to all components managed by clusterctl. ClusterctlLabel = "clusterctl.cluster.x-k8s.io" // ClusterctlCoreLabel is applied to all the core objects managed by clusterctl. ClusterctlCoreLabel = "clusterctl.cluster.x-k8s.io/core" // ClusterctlCoreLabelInventoryValue define the value for ClusterctlCoreLabel to be used for inventory objects. ClusterctlCoreLabelInventoryValue = "inventory" // ClusterctlCoreLabelCertManagerValue define the value for ClusterctlCoreLabel to be used for cert-manager objects. ClusterctlCoreLabelCertManagerValue = "cert-manager" // ClusterctlMoveLabel can be set on CRDs that providers wish to move but that are not part of a Cluster. ClusterctlMoveLabel = "clusterctl.cluster.x-k8s.io/move" // ClusterctlMoveHierarchyLabel can be set on CRDs that providers wish to move with their entire hierarchy, but that are not part of a Cluster. ClusterctlMoveHierarchyLabel = "clusterctl.cluster.x-k8s.io/move-hierarchy" )
const ( // CoreProviderType is a type reserved for Cluster API core repository. CoreProviderType = ProviderType("CoreProvider") // BootstrapProviderType is the type associated with codebases that provide // bootstrapping capabilities. BootstrapProviderType = ProviderType("BootstrapProvider") // InfrastructureProviderType is the type associated with codebases that provide // infrastructure capabilities. InfrastructureProviderType = ProviderType("InfrastructureProvider") // ControlPlaneProviderType is the type associated with codebases that provide // control-plane capabilities. ControlPlaneProviderType = ProviderType("ControlPlaneProvider") // IPAMProviderType is the type associated with codebases that provide // IPAM capabilities. IPAMProviderType = ProviderType("IPAMProvider") // RuntimeExtensionProviderType is the type associated with codebases that provide // runtime extensions. RuntimeExtensionProviderType = ProviderType("RuntimeExtensionProvider") // AddonProviderType is the type associated with codebases that provide // add-on capabilities. AddonProviderType = ProviderType("AddonProvider") // ProviderTypeUnknown is used when the type is unknown. ProviderTypeUnknown = ProviderType("") )
Variables ¶
This section is empty.
Functions ¶
func ManifestLabel ¶
func ManifestLabel(name string, providerType ProviderType) string
ManifestLabel returns the cluster.x-k8s.io/provider label value for a provider/type.
Note: the label uniquely describes the provider type and its kind (e.g. bootstrap-kubeadm); it's not meant to be used to describe each instance of a particular provider.
Types ¶
type Provider ¶
type Provider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// ProviderName indicates the name of the provider.
// +optional
ProviderName string `json:"providerName,omitempty"`
// Type indicates the type of the provider.
// See ProviderType for a list of supported values
// +optional
Type string `json:"type,omitempty"`
// Version indicates the component version.
// +optional
Version string `json:"version,omitempty"`
// WatchedNamespace indicates the namespace where the provider controller is watching.
// If empty the provider controller is watching for objects in all namespaces.
//
// Deprecated: providers complying with the Cluster API v1alpha4 contract or above must watch all namespaces; this field will be removed in a future version of this API
// +optional
WatchedNamespace string `json:"watchedNamespace,omitempty"`
}
Provider defines an entry in the provider inventory.
func (*Provider) Equals ¶
Equals returns true if two providers are identical (same name, provider name, type, version etc.).
func (*Provider) GetProviderType ¶
func (p *Provider) GetProviderType() ProviderType
GetProviderType parse the Provider.Type string field and return the typed representation.
func (*Provider) InstanceName ¶
InstanceName return the a name that uniquely identifies an entry in the provider inventory. The instanceName is composed by the ManifestLabel and by the namespace where the provider is installed; the resulting value uniquely identify a provider instance because clusterctl does not support multiple instances of the same provider to be installed in the same namespace.
func (*Provider) ManifestLabel ¶
ManifestLabel returns the cluster.x-k8s.io/provider label value for an entry in the provider inventory. Please note that this label uniquely identifies the provider, e.g. bootstrap-kubeadm, but not the instances of the provider, e.g. namespace-1/bootstrap-kubeadm and namespace-2/bootstrap-kubeadm.
type ProviderList ¶
type ProviderList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Provider `json:"items"`
}
ProviderList contains a list of Provider.
func (*ProviderList) FilterByNamespace ¶
func (l *ProviderList) FilterByNamespace(namespace string) []Provider
FilterByNamespace returns a new list of providers that reside in the namespace provided.
func (*ProviderList) FilterByProviderNameAndType ¶
func (l *ProviderList) FilterByProviderNameAndType(provider string, providerType ProviderType) []Provider
FilterByProviderNameAndType returns a new list of provider that match the name and type.
func (*ProviderList) FilterByProviderNameNamespaceTypeVersion ¶
func (l *ProviderList) FilterByProviderNameNamespaceTypeVersion(provider, namespace string, providerType ProviderType, version string) []Provider
FilterByProviderNameNamespaceTypeVersion returns a new list of provider that match the name, namespace, type and version.
func (*ProviderList) FilterByType ¶
func (l *ProviderList) FilterByType(providerType ProviderType) []Provider
FilterByType returns a new list of providers that match the given type.
func (*ProviderList) FilterCore ¶
func (l *ProviderList) FilterCore() []Provider
FilterCore returns a new list of providers that are in the core.
func (*ProviderList) FilterNonCore ¶
func (l *ProviderList) FilterNonCore() []Provider
FilterNonCore returns a new list of providers that are not in the core.
type ProviderType ¶
type ProviderType string
ProviderType is a string representation of a Provider type.
func (ProviderType) Order ¶
func (p ProviderType) Order() int
Order return an integer that can be used to sort ProviderType values.