util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewCAIssuer

CreateNewCAIssuer creates an issuer which can be used for an end-to-end test and cleaned up afterwards. Returns an issuerRef for the issuer, a bundle containing the issuer's data and a function to clean up all issuer resources. The cleanup function is always safe to call and should always be called after this function returns, regardless of whether it returned an error or not

func WaitForCertificateReady

func WaitForCertificateReady(f *framework.Framework, cert *cmapi.Certificate) error

WaitForCertificateReady waits until the references Certificate resource is marked as ready

func WaitForPodReady

func WaitForPodReady(f *framework.Framework, pod *corev1.Pod) error

Types

type CertBundle

type CertBundle struct {
	CertificatePEM []byte
	PrivateKeyPEM  []byte
	CAPEM          []byte
}

CertBundle holds PEM data read from a csi-driver-spiffe mounted volume

func ReadCertFromMountPath

func ReadCertFromMountPath(f *framework.Framework, mountPath string, podName string, containerName string) (*CertBundle, error)

ReadCertFromMountPath uses kubectl exec to retrieve tls.crt, tls.key and ca.crt from a running pod

func ReadCertFromSecret

func ReadCertFromSecret(f *framework.Framework, secretName string, secretNamespace string) (*CertBundle, error)

ReadCertFromSecret loads a certificate bundle from a Secret resource

func (*CertBundle) CheckNotEmpty

func (cb *CertBundle) CheckNotEmpty() error

CheckNotEmpty returns an error if any of the PEM entries in the CertBundle are empty

type IssuerCleanupFunc

type IssuerCleanupFunc func() error

IssuerCleanupFunc is called to clean up issuer related resources after a test. Any returned cleanup function should always be safe to call and should always be called at some point after the returning function regardless of whether that function returned an error or not

func CreateSelfSignedIssuer

func CreateSelfSignedIssuer(f *framework.Framework) (*cmmeta.ObjectReference, IssuerCleanupFunc, error)

CreateSelfSignedIssuer creates a SelfSigned ClusterIssuer which can be used to in-turn create CA issuers for tests. Returns an issuerRef for the issuer and a cleanup function to remove the issuer after the test completes. The cleanup function is always safe to call and should always be called after this function returns, regardless of whether it returned an error or not

Jump to

Keyboard shortcuts

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