Documentation ¶
Index ¶
- func AddLabelsToNamespace(kubeClient kubernetes.Interface, name string, ...) error
- func CreateCRD(kubeClient clientset.Interface, namespace string, ...) error
- func CreateClusterRole(kubeClient kubernetes.Interface, relativePath string) error
- func CreateClusterRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
- func CreateDeployment(kubeClient kubernetes.Interface, namespace string, d *appsv1.Deployment) error
- func CreateNamespace(kubeClient kubernetes.Interface, name string) (*v1.Namespace, error)
- func CreateRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
- func CreateServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) (finalizerFn, error)
- func DeleteClusterRole(kubeClient kubernetes.Interface, relativePath string) error
- func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, relativePath string) error
- func DeleteDeployment(kubeClient kubernetes.Interface, namespace, name string) error
- func DeleteNamespace(kubeClient kubernetes.Interface, name string) error
- func DeleteRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) error
- func DeleteServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) error
- func MakeBasicProxier(ns, name string, versions []string, weights []int32) *maegusv1.Proxier
- func MakeCRD(pathToYaml string) (*apiextensionsv1.CustomResourceDefinition, error)
- func MakeDeployment(pathToYaml string) (*appsv1.Deployment, error)
- func MakePod(pathToYaml string) (*v1.Pod, error)
- func PathToOSFile(relativPath string) (*os.File, error)
- func PodRunningAndReady(pod v1.Pod) (bool, error)
- func WaitForCRDReady(listFunc func(opts metav1.ListOptions) (runtime.Object, error)) error
- func WaitForPodsReady(kubeClient kubernetes.Interface, namespace string, timeout time.Duration, ...) error
- func WaitUntilDeploymentGone(kubeClient kubernetes.Interface, namespace, name string, timeout time.Duration) error
- type Framework
- func (f *Framework) CreatePod(namespace string, pod *v1.Pod) error
- func (f *Framework) CreatePodAndWaitUntilReady(namespace string, pod *v1.Pod) error
- func (f *Framework) CreateProxier(ns string, p *maegusv1.Proxier) (*maegusv1.Proxier, error)
- func (f *Framework) CreateProxierAndWaitUntilReady(ns string, p *maegusv1.Proxier) (*maegusv1.Proxier, error)
- func (f *Framework) CreateProxierOperator(namespace string, operatorImage string, namespacesToWatch []string) error
- func (f *Framework) GetPodRestartCount(ns, podName string) (map[string]int32, error)
- func (f *Framework) NewTestCtx(t *testing.T) TestCtx
- func (f *Framework) UpdateProxier(ns string, p *maegusv1.Proxier) (*maegusv1.Proxier, error)
- func (f *Framework) UpdateProxierAndWaitUntilReady(ns string, p *maegusv1.Proxier) (*maegusv1.Proxier, error)
- func (f *Framework) WaitForDeployment(namespace, name string, timeout time.Duration) error
- func (f *Framework) WaitForPodReady(pod *v1.Pod, timeout time.Duration) error
- func (f *Framework) WaitForProxierReady(p *maegusv1.Proxier, timeout time.Duration) error
- func (f *Framework) WaitForServiceReady(namespace, name string, timeout time.Duration) error
- func (f *Framework) WaitUntilServiceGone(namespace, name string, timeout time.Duration) error
- type TestCtx
- func (ctx *TestCtx) AddFinalizerFn(fn finalizerFn)
- func (ctx *TestCtx) Cleanup(t *testing.T)
- func (ctx *TestCtx) CreateNamespace(t *testing.T, kubeClient kubernetes.Interface) string
- func (ctx *TestCtx) GetObjID() string
- func (ctx *TestCtx) SetupProxierRBAC(t *testing.T, ns string, kubeClient kubernetes.Interface)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLabelsToNamespace ¶
func CreateCRD ¶
func CreateCRD(kubeClient clientset.Interface, namespace string, crd *apiextensionsv1.CustomResourceDefinition) error
func CreateClusterRole ¶
func CreateClusterRole(kubeClient kubernetes.Interface, relativePath string) error
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
func CreateDeployment ¶
func CreateDeployment(kubeClient kubernetes.Interface, namespace string, d *appsv1.Deployment) error
func CreateNamespace ¶
func CreateRoleBinding ¶
func CreateRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
func CreateServiceAccount ¶
func CreateServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) (finalizerFn, error)
func DeleteClusterRole ¶
func DeleteClusterRole(kubeClient kubernetes.Interface, relativePath string) error
func DeleteClusterRoleBinding ¶
func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, relativePath string) error
func DeleteDeployment ¶
func DeleteDeployment(kubeClient kubernetes.Interface, namespace, name string) error
func DeleteNamespace ¶
func DeleteNamespace(kubeClient kubernetes.Interface, name string) error
func DeleteRoleBinding ¶
func DeleteRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) error
func DeleteServiceAccount ¶
func DeleteServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) error
func MakeBasicProxier ¶
MakeBasicProxier returns a proxier with given versions and weights.
func MakeCRD ¶
func MakeCRD(pathToYaml string) (*apiextensionsv1.CustomResourceDefinition, error)
func MakeDeployment ¶
func MakeDeployment(pathToYaml string) (*appsv1.Deployment, error)
func PathToOSFile ¶
PathToOSFile opens a file and return the os.File pointer.
func PodRunningAndReady ¶
PodRunningAndReady returns whether a pod is running and each container has passed it's ready state.
func WaitForCRDReady ¶
WaitForCRDReady waits for a custom resource definition to be available for use.
func WaitForPodsReady ¶
func WaitForPodsReady(kubeClient kubernetes.Interface, namespace string, timeout time.Duration, expectedReplicas int, opts metav1.ListOptions) error
WaitForPodsReady waits for a selection of Pods to be running and each container to pass its readiness check.
func WaitUntilDeploymentGone ¶
Types ¶
type Framework ¶
type Framework struct { KubeClient kubernetes.Interface MaegusClientV1 maegusclient.MaegusV1beta1Interface ApiextensionsClientV1 clientset.Interface HTTPClient *http.Client MasterHost string DefaultTimeout time.Duration }
func (*Framework) CreatePodAndWaitUntilReady ¶
func (*Framework) CreateProxier ¶
CreateProxier creates a proxier.
func (*Framework) CreateProxierAndWaitUntilReady ¶
func (f *Framework) CreateProxierAndWaitUntilReady(ns string, p *maegusv1.Proxier) (*maegusv1.Proxier, error)
CreateProxierAndWaitUntilReady creates a proxier instance and waits until ready.
func (*Framework) CreateProxierOperator ¶
func (f *Framework) CreateProxierOperator(namespace string, operatorImage string, namespacesToWatch []string) error
CreateProxierOperator create service account, cluster role, cluster role binding and make deployment for proxier resources.
func (*Framework) GetPodRestartCount ¶
GetPodRestartCount returns a map of container names and their restart counts for a given pod.
func (*Framework) UpdateProxier ¶
UpdateProxier updates a proxier instance.
func (*Framework) UpdateProxierAndWaitUntilReady ¶
func (f *Framework) UpdateProxierAndWaitUntilReady(ns string, p *maegusv1.Proxier) (*maegusv1.Proxier, error)
UpdateProxierAndWaitUntilReady updates a proxier instance and waits until ready.
func (*Framework) WaitForDeployment ¶
WaitForDeployment returns when deployment is created.
func (*Framework) WaitForPodReady ¶
WaitForPodReady returns when pod shifted to running phase or timeout.
func (*Framework) WaitForProxierReady ¶
WaitForProxierReady returns when proxier shifted to running phase or timeout.
func (*Framework) WaitForServiceReady ¶
WaitForServiceReady returns when service is ready.
type TestCtx ¶
type TestCtx struct { ID string // contains filtered or unexported fields }
func (*TestCtx) AddFinalizerFn ¶
func (ctx *TestCtx) AddFinalizerFn(fn finalizerFn)
func (*TestCtx) CreateNamespace ¶
func (*TestCtx) GetObjID ¶
GetObjID returns an ascending ID based on the length of cleanUpFns. It is based on the premise that every new object also appends a new finalizerFn on cleanUpFns. This can e.g. be used to create multiple namespaces in the same test context.