Documentation ¶
Index ¶
- Constants
- Variables
- func CertManagerDescribe(text string, body func()) bool
- func ConformanceDescribe(text string, body func()) bool
- func Failf(format string, args ...interface{})
- func RbacClusterRoleHasAccessToResource(f *Framework, clusterRole string, verb string, resource string) bool
- func RemoveCleanupAction(p CleanupActionHandle)
- func RunCleanupActions()
- func Skipf(format string, args ...interface{})
- type CleanupActionHandle
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) CertificateDurationValid(c *v1.Certificate, duration, fuzz time.Duration)
- func (f *Framework) CertificateRequestDurationValid(c *v1.CertificateRequest, duration, fuzz time.Duration)
- func (f *Framework) CreateKubeNamespace(baseName string) (*v1.Namespace, error)
- func (f *Framework) CreateKubeResourceQuota() (*v1.ResourceQuota, error)
- func (f *Framework) DeleteKubeNamespace(namespace string) error
- func (f *Framework) Helper() *helper.Helper
- func (f *Framework) RequireAddon(a addon.Addon)
- func (f *Framework) RequireGlobalAddon(a addon.Addon)
- func (f *Framework) WaitForKubeNamespaceNotExist(namespace string) error
Constants ¶
const ( // How often to poll for conditions Poll = 2 * time.Second )
Variables ¶
var DefaultConfig = &config.Config{}
DefaultConfig contains the default shared config the is likely parsed from command line arguments.
var Scheme = runtime.NewScheme()
TODO: this really should be done somewhere in cert-manager proper
Functions ¶
func CertManagerDescribe ¶
CertManagerDescribe is a wrapper function for ginkgo describe. Adds namespacing.
func ConformanceDescribe ¶
func RbacClusterRoleHasAccessToResource ¶
func RbacClusterRoleHasAccessToResource(f *Framework, clusterRole string, verb string, resource string) bool
TODO: move this function into a different package
func RemoveCleanupAction ¶
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func RunCleanupActions ¶
func RunCleanupActions()
RunCleanupActions runs all functions installed by AddCleanupAction. It does not remove them (see RemoveCleanupAction) but it does run unlocked, so they may remove themselves.
Types ¶
type CleanupActionHandle ¶
type CleanupActionHandle *int
func AddCleanupAction ¶
func AddCleanupAction(fn func()) CleanupActionHandle
AddCleanupAction installs a function that will be called in the event of the whole test being terminated. This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().
type Framework ¶
type Framework struct { BaseName string Config *config.Config // KubeClientConfig which was used to create the connection. KubeClientConfig *rest.Config // Kubernetes API clientsets KubeClientSet kubernetes.Interface GWClientSet gwapi.Interface CertManagerClientSet clientset.Interface APIExtensionsClientSet apiextcs.Interface // controller-runtime client for newer controllers CRClient crclient.Client // Namespace in which all test resources should reside Namespace *api.Namespace // contains filtered or unexported fields }
Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.
func NewDefaultFramework ¶
NewDefaultFramework makes a new framework for you, similar to NewFramework. It uses the suite-wide 'DefaultConfig' which should be populated by the testing harness in test/e2e/e2e_test.go
func NewFramework ¶
NewFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions). It uses the config provided to it for the duration of the tests.
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) CertificateDurationValid ¶ added in v0.6.0
func (f *Framework) CertificateDurationValid(c *v1.Certificate, duration, fuzz time.Duration)
func (*Framework) CertificateRequestDurationValid ¶ added in v0.9.0
func (f *Framework) CertificateRequestDurationValid(c *v1.CertificateRequest, duration, fuzz time.Duration)
func (*Framework) CreateKubeNamespace ¶
CreateKubeNamespace creates a new Kubernetes Namespace for a test.
func (*Framework) CreateKubeResourceQuota ¶
func (f *Framework) CreateKubeResourceQuota() (*v1.ResourceQuota, error)
CreateKubeResourceQuota provisions a ResourceQuota resource in the target namespace.
func (*Framework) DeleteKubeNamespace ¶
DeleteKubeNamespace will delete a namespace resource
func (*Framework) RequireAddon ¶
RequireAddon calls the Setup and Provision method on the given addon, failing the spec if provisioning fails.
func (*Framework) RequireGlobalAddon ¶
RequireGlobalAddon calls Setup on the given addon. This should be called in specs or describe blocks that require access to any of the global/shared addons in order to ensure their details are available. This method should only ever be called with addons defined in the 'addons' that are present in the 'globals' variable, as they will not be Provisioned properly otherwise.
func (*Framework) WaitForKubeNamespaceNotExist ¶
WaitForKubeNamespaceNotExist will wait for the namespace with the given name to not exist for up to 2 minutes.
Directories ¶
Path | Synopsis |
---|---|
base
Package base implements a basis for plugins that need to use the Kubernetes API to build upon.
|
Package base implements a basis for plugins that need to use the Kubernetes API to build upon. |
vault
package vault contains an addon that installs Vault
|
package vault contains an addon that installs Vault |
venafi
Package venafi implements an addon for the Venafi platform.
|
Package venafi implements an addon for the Venafi platform. |
errors
Package errors contains shared error types that tests and addons can depend upon to communicate information about why something has failed
|
Package errors contains shared error types that tests and addons can depend upon to communicate information about why something has failed |