Documentation ¶
Index ¶
- type FakePodState
- type Kubectl
- func (k Kubectl) PodDelete(kubeconfigPath, namespace, name string) error
- func (k Kubectl) PodLog(kubeconfigPath, namespace, name string) (string, error)
- func (k Kubectl) PodRun(kubeconfigPath, namespace, name, image, cmd string) error
- func (k Kubectl) PodState(kubeconfigPath, namespace, name string) (string, error)
- func (k Kubectl) StorageClasses(kubeconfigPath string) ([]storagev1.StorageClass, error)
- type KubectlFake
- func (k *KubectlFake) PodDelete(kubeconfigPath, namespace, name string) error
- func (k *KubectlFake) PodLog(kubeconfigPath, namespace, name string) (string, error)
- func (k *KubectlFake) PodRun(kubeconfigPath, namespace, name, image, cmd string) error
- func (k *KubectlFake) PodState(kubeconfigPath, namespace, name string) (string, error)
- func (k KubectlFake) StorageClasses(kubeconfigPath string) ([]storagev1.StorageClass, error)
- type Kubectrler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakePodState ¶
type FakePodState int
const ( FakePodUnknown FakePodState = iota FakePodRunning FakePodCompleted FakePodError )
func (FakePodState) String ¶
func (i FakePodState) String() string
type Kubectl ¶
Kubectl is able to perform kubectl cli commands.
func (Kubectl) PodState ¶
PodState returns the "Ready" status reason of the Pod in the cluster addressed by kubeconfigPath. State is PodRunning, PodCompleted, ContainersNotReady or empty when no Pod is found.
func (Kubectl) StorageClasses ¶
func (k Kubectl) StorageClasses(kubeconfigPath string) ([]storagev1.StorageClass, error)
StorageClasses returns all the StorageClasses in the cluster addressed by kubeconfigPath.
type KubectlFake ¶
type KubectlFake struct {
// contains filtered or unexported fields
}
KubectlFake provides a Kubectler for testing.
func (*KubectlFake) PodDelete ¶
func (k *KubectlFake) PodDelete(kubeconfigPath, namespace, name string) error
func (*KubectlFake) PodLog ¶
func (k *KubectlFake) PodLog(kubeconfigPath, namespace, name string) (string, error)
func (*KubectlFake) PodRun ¶
func (k *KubectlFake) PodRun(kubeconfigPath, namespace, name, image, cmd string) error
func (*KubectlFake) PodState ¶
func (k *KubectlFake) PodState(kubeconfigPath, namespace, name string) (string, error)
func (KubectlFake) StorageClasses ¶
func (k KubectlFake) StorageClasses(kubeconfigPath string) ([]storagev1.StorageClass, error)
StorageClasses returns all the StorageClasses in the cluster addressed by kubeconfigPath.
type Kubectrler ¶
type Kubectrler interface { // PodState returns the state of a Pod in the cluster addressed by kubeconfigPath. // State is FakePodRunning, FakePodCompleted, FakePodError or empty when no Pod is found. PodState(kubeconfigPath, namespace, name string) (string, error) // PodRun run a Pod PodRun(kubeconfigPath, namespace, name, image, cmd string) error // PodLog returns the log of a Pod. PodLog(kubeconfigPath, namespace, name string) (string, error) // PodDelete deletes a Pod. PodDelete(kubeconfigPath, namespace, name string) error // StorageClasses returns all the StorageClasses in the cluster addressed by kubeconfigPath. StorageClasses(kubeconfigPath string) ([]storagev1.StorageClass, error) }
Kubectrler is able to perform kubectl cli commands.
Click to show internal directories.
Click to hide internal directories.