Documentation ¶
Index ¶
- Constants
- func GetPodStatuses(ctx cli.Context, namespace string, expectedPodGroups map[string]*PodGroupInfo) (map[string]*PodGroupInfo, error)
- func GetPods(ctx cli.Context, namespace string) ([]string, error)
- func GetPodsFiltered(ctx cli.Context, namespace string, filter string) ([]string, error)
- func RunHelm(exec exechelper.Executor, timeout int, helmArgs ...string) (string, error)
- func RunKubeCTL(exec exechelper.Executor, kubectlArgs ...string) (string, error)
- func RunKubeCTLWithNamespace(exec exechelper.Executor, namespace string, kubectlArgs ...string) (string, error)
- func RunKubeCTLWithNamespaceRetryOnError(exec exechelper.Executor, namespace string, timeout int, kubectlArgs ...string) (string, error)
- func RunKubeCTLWithTimeout(exec exechelper.Executor, timeout int, kubectlArgs ...string) (string, error)
- type ContainerStatus
- type Pod
- type PodGroupInfo
- type PodListResponse
- type PodMetadata
- type PodStatus
Constants ¶
const KubeVersion = "v1.13.4"
KubeVersion is the version of kubernetes we will install and assume to be working with
const Pure1UnpluggedNamespace = "pure1-unplugged"
Pure1UnpluggedNamespace Kubernetes namespace for running the Pure1 Unplugged application
const SystemNamespace = "kube-system"
SystemNamespace Kubernetes namespace for kubernetes infrastructure components
Variables ¶
This section is empty.
Functions ¶
func GetPodStatuses ¶
func GetPodStatuses(ctx cli.Context, namespace string, expectedPodGroups map[string]*PodGroupInfo) (map[string]*PodGroupInfo, error)
GetPodStatuses will list all pods in the given namespace and then fill in the PodGroupInfo map passed in, and return a reference to the completed version. We only consider pods in the group ready if we can find one matching the pattern, and it is in the correct ready status.
func GetPodsFiltered ¶
GetPodsFiltered gets a list of all pods in the given namespace, filtered by if the name contains the given filter string
func RunKubeCTL ¶
func RunKubeCTL(exec exechelper.Executor, kubectlArgs ...string) (string, error)
RunKubeCTL will run 'kubectl' and specify our known location for kubeconfig
func RunKubeCTLWithNamespace ¶
func RunKubeCTLWithNamespace(exec exechelper.Executor, namespace string, kubectlArgs ...string) (string, error)
RunKubeCTLWithNamespace is a helper to inject namespace options into kubectl calls without having to always say "--namespace" blah blah
func RunKubeCTLWithNamespaceRetryOnError ¶
func RunKubeCTLWithNamespaceRetryOnError(exec exechelper.Executor, namespace string, timeout int, kubectlArgs ...string) (string, error)
RunKubeCTLWithNamespaceRetryOnError is a wrapper around `RunKubeCTLWithNamespace` that will blindly retry on any error mostly useful for poking the API server after restarts to swallow errors as things come back online.
func RunKubeCTLWithTimeout ¶
func RunKubeCTLWithTimeout(exec exechelper.Executor, timeout int, kubectlArgs ...string) (string, error)
RunKubeCTLWithTimeout will run 'kubectl' and specify our known location for kubeconfig
Types ¶
type ContainerStatus ¶
type ContainerStatus struct {
Ready bool `json:"ready,omitempty"`
}
ContainerStatus provides minimal json parsing helpers for kubectl output of pod definitions
type Pod ¶
type Pod struct { Metadata PodMetadata `json:"metadata,omitempty"` Status PodStatus `json:"status,omitempty"` }
Pod provides minimal json parsing helpers for kubectl output of pod definitions
type PodGroupInfo ¶
PodGroupInfo defines a pod group that matches some pattern for the name and details about the group. Useful for checking on pods in a replica-set or deployment where you don't know the exact name (and don't care), but want to make sure enough are online.
func NewPodGroupInfo ¶
func NewPodGroupInfo(pattern string, expectedCount int) *PodGroupInfo
NewPodGroupInfo is just a helper to create the PodGroupInfo objects
type PodListResponse ¶
type PodListResponse struct { APIVersion string `json:"apiVersion"` Items []Pod `json:"items,omitempty"` }
PodListResponse provides minimal json parsing helpers for kubectl output of pod definitions
type PodMetadata ¶
type PodMetadata struct {
Name string `json:"name,omitempty"`
}
PodMetadata provides minimal json parsing helpers for kubectl output of pod definitions
type PodStatus ¶
type PodStatus struct { Phase string `json:"phase,omitempty"` ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"` }
PodStatus provides minimal json parsing helpers for kubectl output of pod definitions