testutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const VenConnRBAC = `` /* 1584-byte string literal not displayed */

Generated using:

helm template ./deploy/charts/venafi-kubernetes-agent -n venafi --set venafiConnection.include=true --show-only templates/venafi-connection-VenConnRBAC.yaml | grep -ivE '(helm|\/version)'

Variables

This section is empty.

Functions

func FakeTPP

func FakeTPP(t testing.TB) (*httptest.Server, *x509.Certificate)

func FakeVenafiCloud

func FakeVenafiCloud(t *testing.T) (_ *httptest.Server, _ *x509.Certificate, setAssert func(AssertRequest))

func Parse

func Parse(yamlmanifest string) []ctrlruntime.Object

Parses the YAML manifest. Useful for inlining YAML manifests in Go test files, to be used in conjunction with `undent`.

func Undent

func Undent(s string) string

Undent removes leading indentation/white-space from given string and returns it as a string. Useful for inlining YAML manifests in Go code. Inline YAML manifests in the Go test files makes it easier to read the test case as opposed to reading verbose-y Go structs.

This was copied from https://github.com/jimeh/Undent/blob/main/Undent.go, all credit goes to the author, Jim Myhrberg.

func WithEnvtest

func WithEnvtest(t testing.TB) (_ *envtest.Environment, _ *rest.Config, kclient ctrlruntime.WithWatch)

To see the API server logs, set:

export KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT=true

Types

type AssertRequest

type AssertRequest func(t testing.TB, r *http.Request)

Jump to

Keyboard shortcuts

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