utils

package
v0.0.0-...-437b0eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestContext = TContext{}

TestContext holds e2e CLI flags

Functions

func AddServiceAccountToAdmins

func AddServiceAccountToAdmins(c kubernetes.Interface)

AddServiceAccountToAdmins will add system:serviceaccounts to cluster-admin ClusterRole

func DeleteNS

func DeleteNS(clientset *kubernetes.Clientset, namespace *v1.Namespace)

DeleteNS deletes k8s namespace

func DumpLogs

func DumpLogs(clientset *kubernetes.Clientset, pods ...*v1.Pod)

DumpLogs dumps pod logs

func ForEachYamlDocument

func ForEachYamlDocument(data []byte, action func([]byte))

ForEachYamlDocument executes action for each YAML document (parts of YAML file separated by "---")

func GetAcClient

func GetAcClient(namespace string) (client.Interface, error)

GetAcClient returns client for given namespace which will be used in e2e tests

func IsVersionOlderThan16

func IsVersionOlderThan16() bool

IsVersionOlderThan16 returns true, if k8s version is less than 1.6

func KubeClient

func KubeClient() (*kubernetes.Clientset, error)

KubeClient returns client to standard k8s entities

func LoadConfig

func LoadConfig() *rest.Config

LoadConfig loads k8s client config

func Logf

func Logf(format string, a ...interface{})

Logf prints formatted message to the tests log

func RemoveServiceAccountFromAdmins

func RemoveServiceAccountFromAdmins(c kubernetes.Interface)

RemoveServiceAccountFromAdmins removes system:serviceaccounts from cluster-admin ClusterRole

func SanitizedVersion

func SanitizedVersion() float64

SanitizedVersion parses K8s 2-component version string into float64 representation

func SkipIf14

func SkipIf14()

SkipIf14 makes test to be skipped when running on k8s 1.4

func WaitForPod

func WaitForPod(clientset *kubernetes.Clientset, namespace string, name string, phase v1.PodPhase) *v1.Pod

WaitForPod waits for k8s pod to get to specified running phase

func WaitForPodNotToBeCreated

func WaitForPodNotToBeCreated(clientset *kubernetes.Clientset, namespace string, name string)

WaitForPodNotToBeCreated waits for pod to be created

Types

type AppControllerManager

type AppControllerManager struct {
	Client    client.Interface
	Clientset *kubernetes.Clientset

	Namespace *v1.Namespace
	// contains filtered or unexported fields
}

AppControllerManager is the test controller exposes remote AC operations and test primitives for dependency graphs

func NewAppControllerManager

func NewAppControllerManager() *AppControllerManager

NewAppControllerManager creates new instance of AppControllerManager

func (*AppControllerManager) AfterEach

func (a *AppControllerManager) AfterEach()

AfterEach is an action executed after each test

func (*AppControllerManager) BeforeEach

func (a *AppControllerManager) BeforeEach()

BeforeEach is an action executed before each test

func (*AppControllerManager) DeleteAppControllerPod

func (a *AppControllerManager) DeleteAppControllerPod()

DeleteAppControllerPod deletes pod, where AppController is running

func (*AppControllerManager) Prepare

func (a *AppControllerManager) Prepare()

Prepare starts AppController pod

func (*AppControllerManager) Run

func (a *AppControllerManager) Run() string

Run runs dependency graph deployment with default settings

func (*AppControllerManager) RunWithOptions

func (a *AppControllerManager) RunWithOptions(options interfaces.DependencyGraphOptions) string

RunWithOptions runs dependency graph deployment with given settings

type TContext

type TContext struct {
	Examples string
	Version  string
}

TContext is a structure for CLI flags

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL