gen

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTestNamespace is the default namespace set on resources that
	// are namespaced.
	DefaultTestNamespace = "default-unit-test-ns"
)

Variables

This section is empty.

Functions

func CSR

func CSR(mods ...CSRModifier) ([]byte, error)

func ConfigMap

func ConfigMap(name string, mods ...ConfigMapModifier) *corev1.ConfigMap

func ConfigMapFrom

func ConfigMapFrom(cm *corev1.ConfigMap, mods ...ConfigMapModifier) *corev1.ConfigMap

func MustCSR added in v0.1.2

func MustCSR(t *testing.T, mods ...CSRModifier) []byte

func ObjectMeta

func ObjectMeta(name string, mods ...ObjectMetaModifier) metav1.ObjectMeta

ObjectMeta creates a new metav1.ObjectMeta with the given name, optionally applying the provided ObjectMetaModifiers. It applies a DefaultTestNamespace by default. Cluster-scoped resource generators should explicitly add `SetNamespace("")` to their constructors.

Types

type CSRBuilder

type CSRBuilder struct {
	// contains filtered or unexported fields
}

type CSRModifier

type CSRModifier func(*CSRBuilder)

func SetCSRCommonName

func SetCSRCommonName(cn string) CSRModifier

func SetCSRDNS

func SetCSRDNS(dns []string) CSRModifier

func SetCSREmails

func SetCSREmails(emails []string) CSRModifier

func SetCSRIPs

func SetCSRIPs(ips []string) CSRModifier

func SetCSRIdentities

func SetCSRIdentities(ids []string) CSRModifier

type ConfigMapModifier

type ConfigMapModifier func(*corev1.ConfigMap)

func SetConfigMapData

func SetConfigMapData(data map[string]string) ConfigMapModifier

func SetConfigMapLabels

func SetConfigMapLabels(labels map[string]string) ConfigMapModifier

func SetConfigMapNamespace

func SetConfigMapNamespace(ns string) ConfigMapModifier

func SetConfigMapResourceVersion

func SetConfigMapResourceVersion(version string) ConfigMapModifier

type ObjectMetaModifier

type ObjectMetaModifier func(*metav1.ObjectMeta)

ObjectMetaModifier applies a transformation to the provider ObjectMeta

Jump to

Keyboard shortcuts

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