csrtestinghelpers

package
v0.0.0-...-52527b8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestManagedClusterName = "testmanagedcluster"
)

Variables

This section is empty.

Functions

func AssertActions

func AssertActions(t *testing.T, actualActions []clienttesting.Action, expectedVerbs ...string)

AssertActions asserts the actual actions have the expected action verb

func AssertError

func AssertError(t *testing.T, actual error, expectedErr string)

AssertError asserts the actual error representation is the same with the expected, if the expected error representation is empty, the actual should be nil

func AssertNoActions

func AssertNoActions(t *testing.T, actualActions []clienttesting.Action)

AssertNoActions asserts no actions are happened

func NewApprovedCSR

func NewApprovedCSR(holder CSRHolder) *certv1.CertificateSigningRequest

func NewCSR

func NewDeniedCSR

func NewDeniedCSR(holder CSRHolder) *certv1.CertificateSigningRequest

func NewHubKubeconfigSecret

func NewHubKubeconfigSecret(namespace, name, resourceVersion string, cert *TestCert, data map[string][]byte) *corev1.Secret

func NewKubeconfig

func NewKubeconfig(key, cert []byte) []byte

Types

type CSRHolder

type CSRHolder struct {
	Name         string
	Labels       map[string]string
	SignerName   string
	CN           string
	Orgs         []string
	Username     string
	ReqBlockType string
}

type FakeSyncContext

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

func NewFakeSyncContext

func NewFakeSyncContext(t *testing.T, clusterName string) *FakeSyncContext

func (FakeSyncContext) Queue

func (FakeSyncContext) QueueKey

func (f FakeSyncContext) QueueKey() string

func (FakeSyncContext) Recorder

func (f FakeSyncContext) Recorder() events.Recorder

type TestCert

type TestCert struct {
	Cert []byte
	Key  []byte
}

func NewTestCert

func NewTestCert(commonName string, duration time.Duration) *TestCert

func NewTestCertWithSubject

func NewTestCertWithSubject(subject pkix.Name, duration time.Duration) *TestCert

Jump to

Keyboard shortcuts

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