...

Package envtest

import "edge-infra.dev/test/framework/k8s/envtest"
Overview
Index

Overview ▾

Package envtest helps to set up various pieces of sigs.k8s.io/controller-runtime/pkg/envtest framework to simplify writing K8s controller tests

func New

func New(opts ...Option) (*envtest.Environment, error)

New creates a envtest.Environment that is:

func Setup

func Setup(opts ...Option) *envtest.Environment

Setup combines `New()`, `SetupEnvtestTools()` and starts the created envtest.Environment, can be used to reduce test setup boilerplate.

func SetupEnvtestTools

func SetupEnvtestTools()

SetupEnvtestTools attempts to configure environment variables based on where envtest binary dependencies (etcd, kube-apiserver, kubectl) will be when they are provided by Bazel, by default. It respects existing values set for those binaries, see: https://book.kubebuilder.io/reference/envtest.html#environment-variables

type Environment

Environment is an alias for envtest.Environment

type Environment = envtest.Environment

type Option

Option defines publicly visible options for instantiating envtest

type Option func(*envtestOpts)

func WithoutCRDs

func WithoutCRDs() Option

WithoutCRDs will skip CRD loading during envtest setup. Useful if you need to apply CRDs during your test