Documentation
¶
Index ¶
Constants ¶
View Source
const (
UserClientName = "me@example.com"
)
Variables ¶
This section is empty.
Functions ¶
func RootDirOrSkip ¶
RootDirOrSkip returns the ROOTDIR environment variable, or skips if the variable is undefined or empty.
Types ¶
type Environment ¶
type Environment struct { // Environment holds the controller-runtime envtest Environment *envtest.Environment // AdminClient is a client that is authenticated as admin which has // permissions to do anything. AdminClient client.Client // UserClient is a client that is authenticated as the user "me@example.com", // groups ["group-1", "group-2"]. UserClient client.Client }
Environment is a struct for holding the active and running controller-runtime envtest Environment, as well as approver-policy specific helper resources for running tests.
func RunControlPlane ¶
RunControlPlane runs a local API server and makes it ready for running tests against. Also runs the cert-manager webhook for operating over cert-manager resources. Expects CRD directories to both cert-manager, as well as approver-policy. This *MUST* be provided. Returns a controller-runtime envtest which is ready to be run against.
Click to show internal directories.
Click to hide internal directories.