Documentation ¶
Index ¶
- Constants
- type ClusterFileMap
- type ComponentFileMap
- type FileMap
- type Hypervisor
- func (hypervisor *Hypervisor) CRIImage() (criapi.ImageServiceClient, error)
- func (hypervisor *Hypervisor) CRIRuntime() (criapi.RuntimeServiceClient, error)
- func (hypervisor *Hypervisor) DeletePod(clusterNamespace, clusterName, componentName, podName string) error
- func (hypervisor *Hypervisor) DeletePodWithID(podSandboxID string) error
- func (hypervisor *Hypervisor) DeletePods(clusterNamespace, clusterName, componentName string) error
- func (hypervisor *Hypervisor) EnsureImage(image string) error
- func (hypervisor *Hypervisor) EnsureImages(images ...string) error
- func (hypervisor *Hypervisor) EnsurePod(clusterNamespace, clusterName, componentName string, pod podapi.Pod) (string, error)
- func (hypervisor *Hypervisor) Export() *infrav1alpha1.Hypervisor
- func (hypervisor *Hypervisor) FileUpToDate(clusterNamespace, clusterName, componentName, hostPath, fileContents string) bool
- func (hypervisor *Hypervisor) FreePort(clusterNamespace, clusterName, componentName string) error
- func (hypervisor *Hypervisor) HasPort(clusterNamespace, clusterName, componentName string) (bool, int)
- func (hypervisor *Hypervisor) IsDirty() (bool, error)
- func (hypervisor *Hypervisor) IsPodRunning(clusterNamespace, clusterName, componentName string, pod podapi.Pod) (isPodRunning bool, podSandboxID string, allContainersRunning bool, ...)
- func (hypervisor *Hypervisor) ListAllPods(clusterNamespace, clusterName, componentName string) ([]string, error)
- func (hypervisor *Hypervisor) ListPods(clusterNamespace, clusterName, componentName, podName string) ([]string, error)
- func (hypervisor *Hypervisor) PodSandboxConfig(clusterNamespace, clusterName, componentName string, pod podapi.Pod) (criapi.PodSandboxConfig, error)
- func (hypervisor *Hypervisor) RefreshCachedSpecs() error
- func (hypervisor *Hypervisor) RequestPort(clusterNamespace, clusterName, componentName string) (int, error)
- func (hypervisor *Hypervisor) RunAndWaitForPod(clusterNamespace, clusterName, componentName string, pod podapi.Pod) error
- func (hypervisor *Hypervisor) Specs() (string, error)
- func (hypervisor *Hypervisor) UploadFile(clusterNamespace, clusterName, componentName, hostPath, fileContents string) error
- func (hypervisor *Hypervisor) UploadFiles(clusterNamespace, clusterName, componentName string, files map[string]string) error
- func (hypervisor *Hypervisor) WaitForPod(podSandboxID string) error
- type HypervisorConnectionPool
- type HypervisorList
- type HypervisorMap
- type HypervisorPortAllocation
- type HypervisorPortAllocationList
- type NamespacedClusterFileMap
Constants ¶
const (
// ToolingImage is the tooling image repository and tag
ToolingImage = "oneinfra/tooling:latest"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterFileMap ¶
type ClusterFileMap map[string]ComponentFileMap
ClusterFileMap is a map of component filemaps, with clusters as keys, and component filemaps as values
type ComponentFileMap ¶
ComponentFileMap is a map of filemaps, with component as keys, and filemaps as values
type Hypervisor ¶
type Hypervisor struct { Name string ResourceVersion string Labels map[string]string Annotations map[string]string Public bool IPAddress string Files NamespacedClusterFileMap Endpoint hypervisorEndpoint // contains filtered or unexported fields }
Hypervisor represents an hypervisor
func NewHypervisorFromv1alpha1 ¶
func NewHypervisorFromv1alpha1(hypervisor *infrav1alpha1.Hypervisor, connectionPool *HypervisorConnectionPool) (*Hypervisor, error)
NewHypervisorFromv1alpha1 returns an hypervisor based on a versioned hypervisor
func NewLocalHypervisor ¶
func NewLocalHypervisor(name, criEndpoint string) *Hypervisor
NewLocalHypervisor creates a local hypervisor
func (*Hypervisor) CRIImage ¶
func (hypervisor *Hypervisor) CRIImage() (criapi.ImageServiceClient, error)
CRIImage returns the image service client for the current hypervisor
func (*Hypervisor) CRIRuntime ¶
func (hypervisor *Hypervisor) CRIRuntime() (criapi.RuntimeServiceClient, error)
CRIRuntime returns the runtime service client for the current hypervisor
func (*Hypervisor) DeletePod ¶
func (hypervisor *Hypervisor) DeletePod(clusterNamespace, clusterName, componentName, podName string) error
DeletePod deletes all pods matching the given cluster, component and pod name
func (*Hypervisor) DeletePodWithID ¶
func (hypervisor *Hypervisor) DeletePodWithID(podSandboxID string) error
DeletePodWithID deletes a pod on the current hypervisor
func (*Hypervisor) DeletePods ¶
func (hypervisor *Hypervisor) DeletePods(clusterNamespace, clusterName, componentName string) error
DeletePods deletes all pods matching the given cluster and component
func (*Hypervisor) EnsureImage ¶
func (hypervisor *Hypervisor) EnsureImage(image string) error
EnsureImage ensures that the requested image is present on the current hypervisor
func (*Hypervisor) EnsureImages ¶
func (hypervisor *Hypervisor) EnsureImages(images ...string) error
EnsureImages ensures that the requested images are present on the current hypervisor
func (*Hypervisor) EnsurePod ¶
func (hypervisor *Hypervisor) EnsurePod(clusterNamespace, clusterName, componentName string, pod podapi.Pod) (string, error)
EnsurePod runs a pod on the current hypervisor
func (*Hypervisor) Export ¶
func (hypervisor *Hypervisor) Export() *infrav1alpha1.Hypervisor
Export exports the hypervisor to a versioned hypervisor
func (*Hypervisor) FileUpToDate ¶
func (hypervisor *Hypervisor) FileUpToDate(clusterNamespace, clusterName, componentName, hostPath, fileContents string) bool
FileUpToDate returns whether the given file contents match on the host
func (*Hypervisor) FreePort ¶
func (hypervisor *Hypervisor) FreePort(clusterNamespace, clusterName, componentName string) error
FreePort frees a port on the given hypervisor
func (*Hypervisor) HasPort ¶
func (hypervisor *Hypervisor) HasPort(clusterNamespace, clusterName, componentName string) (bool, int)
HasPort returns whether a port exists for the given clusterName and componentName
func (*Hypervisor) IsDirty ¶
func (hypervisor *Hypervisor) IsDirty() (bool, error)
IsDirty returns whether this cluster is dirty compared to when it was loaded
func (*Hypervisor) IsPodRunning ¶
func (hypervisor *Hypervisor) IsPodRunning(clusterNamespace, clusterName, componentName string, pod podapi.Pod) (isPodRunning bool, podSandboxID string, allContainersRunning bool, runningContainers, notRunningContainers map[string]*criapi.Container, err error)
IsPodRunning returns whether a pod is running on the current hypervisor, along with extra information about the pod sandbox ID, what containers are currently running, and which are not
func (*Hypervisor) ListAllPods ¶
func (hypervisor *Hypervisor) ListAllPods(clusterNamespace, clusterName, componentName string) ([]string, error)
ListAllPods returns a list of pod sandbox ID's that belong to the provided cluster and component
func (*Hypervisor) ListPods ¶
func (hypervisor *Hypervisor) ListPods(clusterNamespace, clusterName, componentName, podName string) ([]string, error)
ListPods returns a list of pod sandbox ID's that belong to the provided cluster, component and pod name
func (*Hypervisor) PodSandboxConfig ¶
func (hypervisor *Hypervisor) PodSandboxConfig(clusterNamespace, clusterName, componentName string, pod podapi.Pod) (criapi.PodSandboxConfig, error)
PodSandboxConfig returns a pod sandbox config for the given pod and cluster
func (*Hypervisor) RefreshCachedSpecs ¶
func (hypervisor *Hypervisor) RefreshCachedSpecs() error
RefreshCachedSpecs refreshes the cached spec
func (*Hypervisor) RequestPort ¶
func (hypervisor *Hypervisor) RequestPort(clusterNamespace, clusterName, componentName string) (int, error)
RequestPort requests a port on the current hypervisor
func (*Hypervisor) RunAndWaitForPod ¶
func (hypervisor *Hypervisor) RunAndWaitForPod(clusterNamespace, clusterName, componentName string, pod podapi.Pod) error
RunAndWaitForPod runs and waits for all containers within a pod to be finished
func (*Hypervisor) Specs ¶
func (hypervisor *Hypervisor) Specs() (string, error)
Specs returns the versioned specs of this hypervisor
func (*Hypervisor) UploadFile ¶
func (hypervisor *Hypervisor) UploadFile(clusterNamespace, clusterName, componentName, hostPath, fileContents string) error
UploadFile uploads a file to the current hypervisor to hostPath with given fileContents
func (*Hypervisor) UploadFiles ¶
func (hypervisor *Hypervisor) UploadFiles(clusterNamespace, clusterName, componentName string, files map[string]string) error
UploadFiles uploads a map of files, with location as keys, and contents as values
func (*Hypervisor) WaitForPod ¶
func (hypervisor *Hypervisor) WaitForPod(podSandboxID string) error
WaitForPod waits for all containers in a pod to have exited
type HypervisorConnectionPool ¶
type HypervisorConnectionPool map[string]hypervisorEndpoint
HypervisorConnectionPool represents an hypervisor connection pool
type HypervisorList ¶
type HypervisorList []*Hypervisor
HypervisorList represents a list of hypervisors
func (HypervisorList) IPAddresses ¶
func (hypervisorList HypervisorList) IPAddresses() []string
IPAddresses returns the list of IP addresses
func (HypervisorList) Sample ¶
func (hypervisorList HypervisorList) Sample() (*Hypervisor, error)
Sample returns a random hypervisor from the current list
type HypervisorMap ¶
type HypervisorMap map[string]*Hypervisor
HypervisorMap represents a map of hypervisors
func (HypervisorMap) List ¶
func (hypervisorMap HypervisorMap) List() HypervisorList
List converts the hypervisor map to an hypervisor list
func (HypervisorMap) PrivateList ¶
func (hypervisorMap HypervisorMap) PrivateList() HypervisorList
PrivateList returns a list of private hypervisors from this map
func (HypervisorMap) PublicList ¶
func (hypervisorMap HypervisorMap) PublicList() HypervisorList
PublicList returns a list of public hypervisors from this map
func (HypervisorMap) Specs ¶
func (hypervisorMap HypervisorMap) Specs() (string, error)
Specs returns the versioned specs of all hypervisors in this map
type HypervisorPortAllocation ¶
type HypervisorPortAllocation struct { ClusterNamespace string Cluster string Component string Port int }
HypervisorPortAllocation represents a port allocation in an hypervisor
type HypervisorPortAllocationList ¶
type HypervisorPortAllocationList []HypervisorPortAllocation
HypervisorPortAllocationList represents a list of port allocations in an hypervisor
func NewHypervisorPortAllocationListFromv1alpha1 ¶
func NewHypervisorPortAllocationListFromv1alpha1(hypervisorPortAllocationList []infrav1alpha1.HypervisorPortAllocation) HypervisorPortAllocationList
NewHypervisorPortAllocationListFromv1alpha1 creates an hypervisor port allocation list
func (HypervisorPortAllocationList) Export ¶
func (hypervisorPortAllocationList HypervisorPortAllocationList) Export() []infrav1alpha1.HypervisorPortAllocation
Export exports the hypervisor port allocation list to a versioned object
type NamespacedClusterFileMap ¶
type NamespacedClusterFileMap map[string]ClusterFileMap
NamespacedClusterFileMap is a map of cluster filemaps, with namespaces as keys, and cluster filemaps as values
func NewNamespacedClusterFileMapFromv1alpha1 ¶
func NewNamespacedClusterFileMapFromv1alpha1(namespacedClusterFileMap infrav1alpha1.NamespacedClusterFileMap) NamespacedClusterFileMap
NewNamespacedClusterFileMapFromv1alpha1 creates a namespaced cluster file map based on a versioned cluster file map
func (NamespacedClusterFileMap) Export ¶
func (namespacedClusterFileMap NamespacedClusterFileMap) Export() infrav1alpha1.NamespacedClusterFileMap
Export exports this cluster file map to a versioned cluster file map