Documentation ¶
Index ¶
- Constants
- func AssertActions(t *testing.T, actualActions []clienttesting.Action, expectedVerbs ...string)
- func AssertCSRCondition(t *testing.T, ...)
- 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 AssertManagedClusterCondition(t *testing.T, actualConditions []metav1.Condition, ...)
- 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 NewAcceptedManagedCluster() *clusterv1.ManagedCluster
- func NewAcceptingManagedCluster() *clusterv1.ManagedCluster
- func NewApprovedCSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
- func NewAvailableManagedCluster() *clusterv1.ManagedCluster
- func NewCSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
- func NewDeletingManagedCluster() *clusterv1.ManagedCluster
- func NewDeniedCSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
- func NewDeniedManagedCluster() *clusterv1.ManagedCluster
- 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(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 NewUnstructuredObj(apiVersion, kind, namespace, name string) *unstructured.Unstructured
- 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 []certv1beta1.CertificateSigningRequestCondition, expectedCondition certv1beta1.CertificateSigningRequestCondition)
AssertCSRCondition asserts the actual csr 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 AssertManagedClusterCondition ¶
func AssertManagedClusterCondition( t *testing.T, actualConditions []metav1.Condition, expectedCondition metav1.Condition)
AssertManagedClusterCondition asserts the actual managed cluster conditions has the expected condition
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 NewAcceptedManagedCluster ¶
func NewAcceptedManagedCluster() *clusterv1.ManagedCluster
func NewAcceptingManagedCluster ¶
func NewAcceptingManagedCluster() *clusterv1.ManagedCluster
func NewApprovedCSR ¶
func NewApprovedCSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
func NewAvailableManagedCluster ¶
func NewAvailableManagedCluster() *clusterv1.ManagedCluster
func NewCSR ¶
func NewCSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
func NewDeletingManagedCluster ¶
func NewDeletingManagedCluster() *clusterv1.ManagedCluster
func NewDeniedCSR ¶
func NewDeniedCSR(holder CSRHolder) *certv1beta1.CertificateSigningRequest
func NewDeniedManagedCluster ¶
func NewDeniedManagedCluster() *clusterv1.ManagedCluster
func NewHubKubeconfigSecret ¶
func NewJoinedManagedCluster ¶
func NewJoinedManagedCluster() *clusterv1.ManagedCluster
func NewKubeconfig ¶
func NewManagedCluster ¶
func NewManagedCluster() *clusterv1.ManagedCluster
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 NewUnstructuredObj ¶
func NewUnstructuredObj(apiVersion, kind, namespace, name string) *unstructured.Unstructured
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