Documentation ¶
Index ¶
- Constants
- func AssertActions(t *testing.T, actualActions []clienttesting.Action, expectedVerbs ...string)
- func AssertCSRCondition(t *testing.T, actualConditions []certv1.CertificateSigningRequestCondition, ...)
- func AssertCondition(t *testing.T, actualConditions []metav1.Condition, ...)
- func AssertError(t *testing.T, actual error, expectedErr string)
- func AssertErrorWithPrefix(t *testing.T, actual error, expectedErrorPrefix string)
- func AssertFileContent(t *testing.T, filePath string, expectedContent []byte)
- func AssertFileExist(t *testing.T, filePath string)
- func AssertFinalizers(t *testing.T, obj runtime.Object, finalizers []string)
- func AssertLeaseUpdated(t *testing.T, lease, lastLease *coordinationv1.Lease)
- func AssertManagedClusterClientConfigs(t *testing.T, actual, expected []clusterv1.ClientConfig)
- func AssertManagedClusterStatus(t *testing.T, actual, expected clusterv1.ManagedClusterStatus)
- func AssertNoActions(t *testing.T, actualActions []clienttesting.Action)
- func AssertNoMoreUpdates(t *testing.T, actions []clienttesting.Action)
- func AssertSubjectAccessReviewObj(t *testing.T, actual runtime.Object)
- func AssertUpdateActions(t *testing.T, actions []clienttesting.Action)
- func AssertV1beta1CSRCondition(t *testing.T, ...)
- func NewAcceptedManagedCluster() *clusterv1.ManagedCluster
- func NewAcceptingManagedCluster() *clusterv1.ManagedCluster
- func NewAddOnLease(namespace, name string, renewTime time.Time) *coordv1.Lease
- func NewApprovedCSR(holder CSRHolder) *certv1.CertificateSigningRequest
- func NewApprovedV1beta1CSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
- func NewAvailableManagedCluster() *clusterv1.ManagedCluster
- func NewCSR(holder CSRHolder) *certv1.CertificateSigningRequest
- func NewDeletingManagedCluster() *clusterv1.ManagedCluster
- func NewDeniedCSR(holder CSRHolder) *certv1.CertificateSigningRequest
- func NewDeniedManagedCluster() *clusterv1.ManagedCluster
- func NewDeniedV1beta1CSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
- func NewHubKubeconfigSecret(namespace, name, resourceVersion string, cert *TestCert, ...) *corev1.Secret
- func NewJoinedManagedCluster() *clusterv1.ManagedCluster
- func NewKubeconfig(key, cert []byte) []byte
- func NewManagedCluster() *clusterv1.ManagedCluster
- func NewManagedClusterCondition(name, status, reason, message string, lastTransition *metav1.Time) metav1.Condition
- func NewManagedClusterLease(name string, renewTime time.Time) *coordv1.Lease
- func NewManagedClusterWithStatus(capacity, allocatable corev1.ResourceList) *clusterv1.ManagedCluster
- func NewManifestWork(namespace, name string, finalizers []string, deletionTimestamp *metav1.Time) *workapiv1.ManifestWork
- func NewNamespace(name string, terminated bool) *corev1.Namespace
- func NewNode(name string, capacity, allocatable corev1.ResourceList) *corev1.Node
- func NewResourceList(cpu, mem int) corev1.ResourceList
- func NewRole(namespace, name string, finalizers []string, terminated bool) *rbacv1.Role
- func NewRoleBinding(namespace, name string, finalizers []string, terminated bool) *rbacv1.RoleBinding
- func NewUnAvailableManagedCluster() *clusterv1.ManagedCluster
- func NewUnknownManagedCluster() *clusterv1.ManagedCluster
- func NewUnstructuredObj(apiVersion, kind, namespace, name string) *unstructured.Unstructured
- func NewV1beta1CSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
- func WriteFile(filename string, data []byte)
- type CSRHolder
- type FakeSyncContext
- type TestCert
Constants ¶
const ( TestLeaseDurationSeconds int32 = 1 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 AssertCSRCondition ¶
func AssertCSRCondition( t *testing.T, actualConditions []certv1.CertificateSigningRequestCondition, expectedCondition certv1.CertificateSigningRequestCondition)
AssertCSRCondition asserts the actual csr conditions has the expected condition
func AssertCondition ¶ added in v0.8.0
func AssertCondition( t *testing.T, actualConditions []metav1.Condition, expectedCondition metav1.Condition)
AssertCondition asserts the actual conditions has the expected condition
func AssertError ¶
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 AssertErrorWithPrefix ¶
AssertError asserts the actual error representation starts with the expected prerfix, if the expected error prefix is empty, the actual should be nil
func AssertFileContent ¶
AssertFileContent asserts a given file content
func AssertFileExist ¶
AssertFileExist asserts a given file exists
func AssertFinalizers ¶
AssertFinalizers asserts the given runtime object has the expected finalizers
func AssertLeaseUpdated ¶
func AssertLeaseUpdated(t *testing.T, lease, lastLease *coordinationv1.Lease)
AssertLeaseUpdated asserts the lease obj is updated
func AssertManagedClusterClientConfigs ¶
func AssertManagedClusterClientConfigs(t *testing.T, actual, expected []clusterv1.ClientConfig)
AssertManagedClusterClientConfigs asserts the actual managed cluster client configs are the same wiht the expected
func AssertManagedClusterStatus ¶
func AssertManagedClusterStatus(t *testing.T, actual, expected clusterv1.ManagedClusterStatus)
AssertManagedClusterStatus sserts the actual managed cluster status is the same wiht the expected
func AssertNoActions ¶
func AssertNoActions(t *testing.T, actualActions []clienttesting.Action)
AssertNoActions asserts no actions are happened
func AssertNoMoreUpdates ¶
func AssertNoMoreUpdates(t *testing.T, actions []clienttesting.Action)
AssertNoMoreUpdates asserts only one update action in given actions
func AssertSubjectAccessReviewObj ¶
AssertSubjectAccessReviewObj asserts the given runtime object is the authorization SubjectAccessReview object
func AssertUpdateActions ¶
func AssertUpdateActions(t *testing.T, actions []clienttesting.Action)
AssertUpdateActions asserts the actions are get-then-update action
func AssertV1beta1CSRCondition ¶ added in v0.8.0
func AssertV1beta1CSRCondition( t *testing.T, actualConditions []certv1beta1.CertificateSigningRequestCondition, expectedCondition certv1beta1.CertificateSigningRequestCondition)
AssertV1beta1CSRCondition asserts the actual csr conditions has the expected condition
func NewAcceptedManagedCluster ¶
func NewAcceptedManagedCluster() *clusterv1.ManagedCluster
func NewAcceptingManagedCluster ¶
func NewAcceptingManagedCluster() *clusterv1.ManagedCluster
func NewApprovedCSR ¶
func NewApprovedCSR(holder CSRHolder) *certv1.CertificateSigningRequest
func NewApprovedV1beta1CSR ¶ added in v0.8.0
func NewApprovedV1beta1CSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
func NewAvailableManagedCluster ¶
func NewAvailableManagedCluster() *clusterv1.ManagedCluster
func NewCSR ¶
func NewCSR(holder CSRHolder) *certv1.CertificateSigningRequest
func NewDeletingManagedCluster ¶
func NewDeletingManagedCluster() *clusterv1.ManagedCluster
func NewDeniedCSR ¶
func NewDeniedCSR(holder CSRHolder) *certv1.CertificateSigningRequest
func NewDeniedManagedCluster ¶
func NewDeniedManagedCluster() *clusterv1.ManagedCluster
func NewDeniedV1beta1CSR ¶ added in v0.8.0
func NewDeniedV1beta1CSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
func NewHubKubeconfigSecret ¶
func NewJoinedManagedCluster ¶
func NewJoinedManagedCluster() *clusterv1.ManagedCluster
func NewKubeconfig ¶
func NewManagedCluster ¶
func NewManagedCluster() *clusterv1.ManagedCluster
func NewManagedClusterLease ¶
func NewManagedClusterWithStatus ¶
func NewManagedClusterWithStatus(capacity, allocatable corev1.ResourceList) *clusterv1.ManagedCluster
func NewManifestWork ¶
func NewResourceList ¶
func NewResourceList(cpu, mem int) corev1.ResourceList
func NewRoleBinding ¶
func NewRoleBinding(namespace, name string, finalizers []string, terminated bool) *rbacv1.RoleBinding
func NewUnAvailableManagedCluster ¶ added in v0.7.0
func NewUnAvailableManagedCluster() *clusterv1.ManagedCluster
func NewUnknownManagedCluster ¶
func NewUnknownManagedCluster() *clusterv1.ManagedCluster
func NewUnstructuredObj ¶
func NewUnstructuredObj(apiVersion, kind, namespace, name string) *unstructured.Unstructured
func NewV1beta1CSR ¶ added in v0.8.0
func NewV1beta1CSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
Types ¶
type FakeSyncContext ¶
type FakeSyncContext struct {
// contains filtered or unexported fields
}
func NewFakeSyncContext ¶
func NewFakeSyncContext(t *testing.T, clusterName string) *FakeSyncContext
func (FakeSyncContext) Queue ¶
func (f FakeSyncContext) Queue() workqueue.RateLimitingInterface
func (FakeSyncContext) QueueKey ¶
func (f FakeSyncContext) QueueKey() string
func (FakeSyncContext) Recorder ¶
func (f FakeSyncContext) Recorder() events.Recorder