...

Package e2eutil

import "sigs.k8s.io/cli-utils/test/e2e/e2eutil"
Overview
Index

Overview ▾

Index ▾

Constants
Variables
func ApplyUnstructured(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func AssertUnstructuredAvailable(obj *unstructured.Unstructured)
func AssertUnstructuredCount(ctx context.Context, c client.Client, obj *unstructured.Unstructured, count int)
func AssertUnstructuredDoesNotExist(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func AssertUnstructuredExists(ctx context.Context, c client.Client, obj *unstructured.Unstructured) *unstructured.Unstructured
func CreateInventoryCRD(ctx context.Context, c client.Client)
func CreateRandomNamespace(ctx context.Context, c client.Client) *v1.Namespace
func CreateUnstructuredAndWait(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func DeleteAllUnstructuredIfExists(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func DeleteInventoryCRD(ctx context.Context, c client.Client)
func DeleteNamespace(ctx context.Context, c client.Client, namespace *v1.Namespace)
func DeleteUnstructuredAndWait(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func DeleteUnstructuredIfExists(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func ExpectNoEventErrors(events []event.Event, callerSkip ...int)
func ExpectNoReconcileTimeouts(events []event.Event, callerSkip ...int)
func FilterOptionalEvents(expected, received []testutil.ExpEvent) ([]testutil.ExpEvent, []testutil.ExpEvent)
func IsFlowControlEnabled(config *rest.Config) bool
func ManifestToUnstructured(manifest []byte) *unstructured.Unstructured
func PodWithImage(obj *unstructured.Unstructured, containerName, image string) *unstructured.Unstructured
func RandomString(prefix string) string
func Run(ch <-chan event.Event) error
func RunCollect(ch <-chan event.Event) []event.Event
func RunCollectNoErr(ch <-chan event.Event, callerSkip ...int) []event.Event
func TemplateToUnstructured(tmpl string, data interface{}) *unstructured.Unstructured
func UnstructuredExistsAndIsNotTerminating(ctx context.Context, c client.Client, obj *unstructured.Unstructured) bool
func UnstructuredIsTerminating(obj *unstructured.Unstructured) bool
func UnstructuredNamespace(name string) *unstructured.Unstructured
func UserAgent(suffix string) string
func WaitForCreation(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func WaitForDeletion(ctx context.Context, c client.Client, obj *unstructured.Unstructured)
func WithAnnotation(obj *unstructured.Unstructured, key, value string) *unstructured.Unstructured
func WithDependsOn(obj *unstructured.Unstructured, dep string) *unstructured.Unstructured
func WithNamespace(obj *unstructured.Unstructured, namespace string) *unstructured.Unstructured
func WithNodeSelector(obj *unstructured.Unstructured, key, value string) *unstructured.Unstructured
func WithReplicas(obj *unstructured.Unstructured, replicas int) *unstructured.Unstructured

Package files

common.go rest.go

Constants

const TestIDLabel = "test-id"

Variables

var RunWithNoErr = RunCollectNoErr

func ApplyUnstructured

func ApplyUnstructured(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func AssertUnstructuredAvailable

func AssertUnstructuredAvailable(obj *unstructured.Unstructured)

func AssertUnstructuredCount

func AssertUnstructuredCount(ctx context.Context, c client.Client, obj *unstructured.Unstructured, count int)

func AssertUnstructuredDoesNotExist

func AssertUnstructuredDoesNotExist(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func AssertUnstructuredExists

func AssertUnstructuredExists(ctx context.Context, c client.Client, obj *unstructured.Unstructured) *unstructured.Unstructured

func CreateInventoryCRD

func CreateInventoryCRD(ctx context.Context, c client.Client)

func CreateRandomNamespace

func CreateRandomNamespace(ctx context.Context, c client.Client) *v1.Namespace

func CreateUnstructuredAndWait

func CreateUnstructuredAndWait(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func DeleteAllUnstructuredIfExists

func DeleteAllUnstructuredIfExists(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func DeleteInventoryCRD

func DeleteInventoryCRD(ctx context.Context, c client.Client)

func DeleteNamespace

func DeleteNamespace(ctx context.Context, c client.Client, namespace *v1.Namespace)

func DeleteUnstructuredAndWait

func DeleteUnstructuredAndWait(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func DeleteUnstructuredIfExists

func DeleteUnstructuredIfExists(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func ExpectNoEventErrors

func ExpectNoEventErrors(events []event.Event, callerSkip ...int)

func ExpectNoReconcileTimeouts

func ExpectNoReconcileTimeouts(events []event.Event, callerSkip ...int)

func FilterOptionalEvents

func FilterOptionalEvents(expected, received []testutil.ExpEvent) ([]testutil.ExpEvent, []testutil.ExpEvent)

FilterOptionalEvents looks for optional events in the expected list and removes them from both lists. This allows the output to be compared for equality.

Optional events include: - WaitEvent with ReconcilePending

func IsFlowControlEnabled

func IsFlowControlEnabled(config *rest.Config) bool

func ManifestToUnstructured

func ManifestToUnstructured(manifest []byte) *unstructured.Unstructured

func PodWithImage

func PodWithImage(obj *unstructured.Unstructured, containerName, image string) *unstructured.Unstructured

func RandomString

func RandomString(prefix string) string

func Run

func Run(ch <-chan event.Event) error

func RunCollect

func RunCollect(ch <-chan event.Event) []event.Event

func RunCollectNoErr

func RunCollectNoErr(ch <-chan event.Event, callerSkip ...int) []event.Event

func TemplateToUnstructured

func TemplateToUnstructured(tmpl string, data interface{}) *unstructured.Unstructured

func UnstructuredExistsAndIsNotTerminating

func UnstructuredExistsAndIsNotTerminating(ctx context.Context, c client.Client, obj *unstructured.Unstructured) bool

func UnstructuredIsTerminating

func UnstructuredIsTerminating(obj *unstructured.Unstructured) bool

func UnstructuredNamespace

func UnstructuredNamespace(name string) *unstructured.Unstructured

func UserAgent

func UserAgent(suffix string) string

UserAgent returns the a User-Agent for use with HTTP clients. The string corresponds to the current version of the binary being executed, using metadata from git and go.

func WaitForCreation

func WaitForCreation(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func WaitForDeletion

func WaitForDeletion(ctx context.Context, c client.Client, obj *unstructured.Unstructured)

func WithAnnotation

func WithAnnotation(obj *unstructured.Unstructured, key, value string) *unstructured.Unstructured

func WithDependsOn

func WithDependsOn(obj *unstructured.Unstructured, dep string) *unstructured.Unstructured

func WithNamespace

func WithNamespace(obj *unstructured.Unstructured, namespace string) *unstructured.Unstructured

func WithNodeSelector

func WithNodeSelector(obj *unstructured.Unstructured, key, value string) *unstructured.Unstructured

func WithReplicas

func WithReplicas(obj *unstructured.Unstructured, replicas int) *unstructured.Unstructured