Documentation ¶
Index ¶
- Constants
- Variables
- func Capture() func() (string, error)
- func ContainExpectStrings(out string, expectStrings ...string) bool
- func FakeActionSet() *dpv1alpha1.ActionSet
- func FakeAddon(name string) *extensionsv1alpha1.Addon
- func FakeBackup(backupName string) *dpv1alpha1.Backup
- func FakeBackupPolicy(backupPolicyName, clusterName string) *dpv1alpha1.BackupPolicy
- func FakeBackupPolicyTemplate(backupPolicyTemplateName string, clusterDef string) *appsv1alpha1.BackupPolicyTemplate
- func FakeBackupRepo(name string, isDefault bool) *dpv1alpha1.BackupRepo
- func FakeBackupSchedule(backupScheduleName, backupPolicyName string) *dpv1alpha1.BackupSchedule
- func FakeBackupWithCluster(cluster *appsv1alpha1.Cluster, backupName string) *dpv1alpha1.Backup
- func FakeClientSet(objects ...runtime.Object) *kubefakeclient.Clientset
- func FakeCluster(name, namespace string, conditions ...metav1.Condition) *appsv1alpha1.Cluster
- func FakeClusterDef() *appsv1alpha1.ClusterDefinition
- func FakeClusterList() *appsv1alpha1.ClusterList
- func FakeClusterRole(name string) *rbacv1.ClusterRole
- func FakeClusterRoleBinding(name string, sa *corev1.ServiceAccount, clusterRole *rbacv1.ClusterRole) *rbacv1.ClusterRoleBinding
- func FakeClusterVersion() *appsv1alpha1.ClusterVersion
- func FakeCompDef() *appsv1alpha1.ComponentDefinition
- func FakeComponentClassDef(name string, clusterDefRef string, componentDefRef string) *appsv1alpha1.ComponentClassDefinition
- func FakeConfigConstraint(ccName string) *appsv1beta1.ConfigConstraint
- func FakeConfigMap(cmName string, namespace string, data map[string]string) *corev1.ConfigMap
- func FakeCronJob(name string, namespace string, extraLabels map[string]string) *batchv1.CronJob
- func FakeDeploy(name string, namespace string, extraLabels map[string]string) *appsv1.Deployment
- func FakeDynamicClient(objects ...runtime.Object) *dynamicfakeclient.FakeDynamicClient
- func FakeEventForObject(name string, namespace string, object string) *corev1.Event
- func FakeEvents() *corev1.EventList
- func FakeJob(name string, namespace string, extraLabels map[string]string) *batchv1.Job
- func FakeKBClientSet(objects ...runtime.Object) *kbfakeclient.Clientset
- func FakeKBDeploy(version string) *appsv1.Deployment
- func FakeMetricsClientSet(objects ...runtime.Object) *metricsfakeclient.Clientset
- func FakeNode() *corev1.Node
- func FakePVCs() *corev1.PersistentVolumeClaimList
- func FakePodChaos(name, namespace string) *chaosmeshv1alpha1.PodChaos
- func FakePodForSts(sts *appsv1.StatefulSet) *corev1.PodList
- func FakePods(replicas int, namespace string, cluster string) *corev1.PodList
- func FakeResourceNotFound(versionResource schema.GroupVersionResource, name string) *metav1.Status
- func FakeRole(name string) *rbacv1.Role
- func FakeRoleBinding(name string, sa *corev1.ServiceAccount, role *rbacv1.Role) *rbacv1.RoleBinding
- func FakeSecret(namespace string, cluster string) *corev1.Secret
- func FakeSecrets(namespace string, cluster string) *corev1.SecretList
- func FakeSecretsWithLabels(namespace string, labels map[string]string) *corev1.SecretList
- func FakeServiceAccount(name string) *corev1.ServiceAccount
- func FakeServiceRef(serviceRefName string) appsv1alpha1.ServiceRefDeclaration
- func FakeServices() *corev1.ServiceList
- func FakeStatefulSet(name string, namespace string, extraLabels map[string]string) *appsv1.StatefulSet
- func FakeStorageClass(name string, isDefault bool) *storagev1.StorageClass
- func FakeStorageProvider(name string, mutateFunc func(obj *storagev1alpha1.StorageProvider)) *storagev1alpha1.StorageProvider
- func FakeVolumeSnapshotClass() *snapshotv1.VolumeSnapshotClass
- func GetRandomStr() string
- func NewTestFactory(namespace string) *cmdtesting.TestFactory
Constants ¶
View Source
const ( ClusterName = "fake-cluster-name" Namespace = "fake-namespace" ClusterVersionName = "fake-cluster-version" ClusterDefName = "fake-cluster-definition" CompDefName = "fake-component-definition" ComponentName = "fake-component-name" ComponentDefName = "fake-component-type" NodeName = "fake-node-name" SecretName = "fake-secret-conn-credential" StorageClassName = "fake-storage-class" PVCName = "fake-pvc" ServiceRefName = "fake-serviceRef" KubeBlocksRepoName = "fake-kubeblocks-repo" KubeBlocksChartName = "fake-kubeblocks" KubeBlocksChartURL = "fake-kubeblocks-chart-url" BackupMethodName = "fake-backup-method" ActionSetName = "fake-action-set" BackupName = "fake-backup-name" IsDefault = true IsNotDefault = false )
Variables ¶
View Source
var (
ExtraComponentDefName = fmt.Sprintf("%s-%d", ComponentDefName, 1)
)
Functions ¶
func Capture ¶
Capture replaces os.Stdout with a writer that buffers any data written to os.Stdout. Call the returned function to clean up and return the data as a string.
func ContainExpectStrings ¶
ContainExpectStrings checks if the specific string contains the expected strings.
func FakeActionSet ¶
func FakeActionSet() *dpv1alpha1.ActionSet
func FakeAddon ¶
func FakeAddon(name string) *extensionsv1alpha1.Addon
func FakeBackup ¶
func FakeBackup(backupName string) *dpv1alpha1.Backup
func FakeBackupPolicy ¶
func FakeBackupPolicy(backupPolicyName, clusterName string) *dpv1alpha1.BackupPolicy
func FakeBackupPolicyTemplate ¶
func FakeBackupPolicyTemplate(backupPolicyTemplateName string, clusterDef string) *appsv1alpha1.BackupPolicyTemplate
func FakeBackupRepo ¶
func FakeBackupRepo(name string, isDefault bool) *dpv1alpha1.BackupRepo
func FakeBackupSchedule ¶
func FakeBackupSchedule(backupScheduleName, backupPolicyName string) *dpv1alpha1.BackupSchedule
func FakeBackupWithCluster ¶
func FakeBackupWithCluster(cluster *appsv1alpha1.Cluster, backupName string) *dpv1alpha1.Backup
func FakeClientSet ¶
func FakeClientSet(objects ...runtime.Object) *kubefakeclient.Clientset
func FakeCluster ¶
func FakeCluster(name, namespace string, conditions ...metav1.Condition) *appsv1alpha1.Cluster
func FakeClusterDef ¶
func FakeClusterDef() *appsv1alpha1.ClusterDefinition
func FakeClusterList ¶
func FakeClusterList() *appsv1alpha1.ClusterList
func FakeClusterRole ¶
func FakeClusterRole(name string) *rbacv1.ClusterRole
func FakeClusterRoleBinding ¶
func FakeClusterRoleBinding(name string, sa *corev1.ServiceAccount, clusterRole *rbacv1.ClusterRole) *rbacv1.ClusterRoleBinding
func FakeClusterVersion ¶
func FakeClusterVersion() *appsv1alpha1.ClusterVersion
func FakeCompDef ¶ added in v0.7.2
func FakeCompDef() *appsv1alpha1.ComponentDefinition
func FakeComponentClassDef ¶
func FakeComponentClassDef(name string, clusterDefRef string, componentDefRef string) *appsv1alpha1.ComponentClassDefinition
func FakeConfigConstraint ¶
func FakeConfigConstraint(ccName string) *appsv1beta1.ConfigConstraint
func FakeConfigMap ¶
func FakeCronJob ¶
func FakeDeploy ¶
func FakeDynamicClient ¶
func FakeDynamicClient(objects ...runtime.Object) *dynamicfakeclient.FakeDynamicClient
func FakeEventForObject ¶
func FakeEvents ¶
func FakeKBClientSet ¶
func FakeKBClientSet(objects ...runtime.Object) *kbfakeclient.Clientset
func FakeKBDeploy ¶
func FakeKBDeploy(version string) *appsv1.Deployment
func FakeMetricsClientSet ¶
func FakeMetricsClientSet(objects ...runtime.Object) *metricsfakeclient.Clientset
func FakePVCs ¶
func FakePVCs() *corev1.PersistentVolumeClaimList
func FakePodChaos ¶
func FakePodChaos(name, namespace string) *chaosmeshv1alpha1.PodChaos
func FakePodForSts ¶
func FakePodForSts(sts *appsv1.StatefulSet) *corev1.PodList
func FakeResourceNotFound ¶
func FakeResourceNotFound(versionResource schema.GroupVersionResource, name string) *metav1.Status
func FakeRoleBinding ¶
func FakeRoleBinding(name string, sa *corev1.ServiceAccount, role *rbacv1.Role) *rbacv1.RoleBinding
func FakeSecret ¶
FakeSecret for test cluster create
func FakeSecrets ¶
func FakeSecrets(namespace string, cluster string) *corev1.SecretList
func FakeSecretsWithLabels ¶
func FakeSecretsWithLabels(namespace string, labels map[string]string) *corev1.SecretList
func FakeServiceAccount ¶
func FakeServiceAccount(name string) *corev1.ServiceAccount
func FakeServiceRef ¶
func FakeServiceRef(serviceRefName string) appsv1alpha1.ServiceRefDeclaration
func FakeServices ¶
func FakeServices() *corev1.ServiceList
func FakeStatefulSet ¶
func FakeStorageClass ¶
func FakeStorageClass(name string, isDefault bool) *storagev1.StorageClass
func FakeStorageProvider ¶
func FakeStorageProvider(name string, mutateFunc func(obj *storagev1alpha1.StorageProvider)) *storagev1alpha1.StorageProvider
func FakeVolumeSnapshotClass ¶
func FakeVolumeSnapshotClass() *snapshotv1.VolumeSnapshotClass
func GetRandomStr ¶
func GetRandomStr() string
func NewTestFactory ¶
func NewTestFactory(namespace string) *cmdtesting.TestFactory
NewTestFactory is like cmdtesting.NewTestFactory, registers KubeBlocks custom objects
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.