Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfigFromFile(kubeconfig string) (*rest.Config, error)
- func GetFakeClient() client.Client
- func GetFakeClientWithObjects(initObjs ...client.Object) client.Client
- func GetLogger() logr.Logger
- func GetNonReplicationEnabledSC(provisionerName, scName string) *storagev1.StorageClass
- func GetPVCObj(pvcName string, namespace string, sc string) *v1.PersistentVolumeClaim
- func GetPVObj(name, volHandle, provisionerName, scName string, ...) *v1.PersistentVolume
- func GetParams(remoteClusterID, remoteSCName string) map[string]string
- func GetRGObj(name, driverName, remoteClusterID, pgID, remotePGID string, ...) *repv1.DellCSIReplicationGroup
- func GetReplicationEnabledSC(provisionerName, scName, remoteSCName, remoteClusterID string) *storagev1.StorageClass
- func GetReplicationEnabledSCWithMetroMode(provisionerName, scName, modeParamName string) *storagev1.StorageClass
- func InitializeSchemes()
- func RunServer(stubsPath string)
- func StopMockServer()
- func ValidateAnnotations(annotations map[string]string, t *testing.T)
- func ValidateRemotePVAnnotations(annotations map[string]string, t *testing.T)
- func ValidateRemoteRGAnnotations(annotations map[string]string, t *testing.T)
- func WaitForAllToBeBound(ctx context.Context, k8sClient client.Client, t *testing.T) error
- type Common
- type Driver
- type MockUtils
Constants ¶
const ( // FakePVName name of PV FakePVName = "fake-pv" // FakePVCName name of PVC FakePVCName = "fake-pvc" // FakeSCName name of SC FakeSCName = "fake-sc" // FakeDriverName name of driver FakeDriverName = "fake-csi-driver" // FakeRemoteSCName name of remote SC FakeRemoteSCName = "fake-remote-sc" // FakeRGName name of remote RG FakeRGName = "fake-rg" // FakeNamespaceName name of namespace FakeNamespaceName = "fake-namespace" // Self this cluster Self = "self" // RemoteClusterID id remote cluster RemoteClusterID = "remoteCluster" // SourceClusterID id source cluster SourceClusterID = "sourceCluster" // LocalPGID id of local protection group LocalPGID = "l-group-id" // RemotePGID id of remote protection group RemotePGID = "r-group-id" // ContextPrefix fake csi replication prefix ContextPrefix = "csi-fake" )
const PVCName = "test-pvc"
PVCName name of testing PVC
Variables ¶
var MockServer *grpc.Server
MockServer mock grpc server
var Scheme = runtime.NewScheme()
Scheme runtime Scheme
Functions ¶
func GetConfigFromFile ¶
GetConfigFromFile creates *rest.Config object from provided config path
func GetFakeClientWithObjects ¶
GetFakeClientWithObjects returns fake k8s client and populates it with given objects
func GetNonReplicationEnabledSC ¶
func GetNonReplicationEnabledSC(provisionerName, scName string) *storagev1.StorageClass
GetNonReplicationEnabledSC returns usual StorageClass testing object
func GetPVCObj ¶
func GetPVCObj(pvcName string, namespace string, sc string) *v1.PersistentVolumeClaim
GetPVCObj returns PersistentVolumeClaim testing object
func GetPVObj ¶
func GetPVObj(name, volHandle, provisionerName, scName string, volAttributes map[string]string) *v1.PersistentVolume
GetPVObj returns PersistentVolume testing object
func GetRGObj ¶
func GetRGObj(name, driverName, remoteClusterID, pgID, remotePGID string, params, remoteParams map[string]string, ) *repv1.DellCSIReplicationGroup
GetRGObj returns DellCSIReplicationGroup testing object
func GetReplicationEnabledSC ¶
func GetReplicationEnabledSC(provisionerName, scName, remoteSCName, remoteClusterID string) *storagev1.StorageClass
GetReplicationEnabledSC returns replication enabled StorageClass testing object
func GetReplicationEnabledSCWithMetroMode ¶ added in v1.10.0
func GetReplicationEnabledSCWithMetroMode(provisionerName, scName, modeParamName string) *storagev1.StorageClass
GetReplicationEnabledSCWithMetroMode returns replication enabled StorageClass testing object with Metro mode
func InitializeSchemes ¶
func InitializeSchemes()
InitializeSchemes inits client-go and replication v1 schemes
func ValidateAnnotations ¶
ValidateAnnotations validates that given annotations are correct
func ValidateRemotePVAnnotations ¶
ValidateRemotePVAnnotations validates that given PV annotations are correct
func ValidateRemoteRGAnnotations ¶
ValidateRemoteRGAnnotations validates that given RG annotations are correct
Types ¶
type Driver ¶
type Driver struct { DriverName string StorageClass string RemoteClusterID string RemoteSCName string SourceClusterID string Namespace string RGName string PVName string }
Driver mock implementation of the driver
func GetDefaultDriver ¶
func GetDefaultDriver() Driver
GetDefaultDriver returns default mock implementation of the driver