Documentation
¶
Index ¶
- func CreateSimpleInstance(k8sEnv K8sOperatorEnvironment, instanceName string, version string, ...)
- func CreateSimplePDB(k8sEnv K8sOperatorEnvironment, instanceName string)
- func CreateSimplePdbWithDbObj(k8sEnv K8sOperatorEnvironment, database *v1alpha1.Database)
- func DeployOperator(ctx context.Context, k8sClient client.Client, namespace string) (func() error, error)
- func GCloudServiceAccount() string
- func InsertSimpleData(k8sEnv K8sOperatorEnvironment)
- func IsCanaryJob() bool
- func K8sCreateAndGet(k8sClient client.Client, ctx context.Context, objKey client.ObjectKey, ...)
- func K8sCreateWithRetry(k8sClient client.Client, ctx context.Context, obj client.Object)
- func K8sDeleteWithRetry(k8sClient client.Client, ctx context.Context, obj client.Object)
- func K8sExec(pod string, ns string, container string, cmd string) (string, error)
- func K8sExecuteSql(pod string, ns string, sql string) (string, error)
- func K8sExecuteSqlOrFail(pod, ns, sql string) string
- func K8sGetAndUpdateStatusWithRetry(k8sClient client.Client, ctx context.Context, objKey client.ObjectKey, ...)
- func K8sGetAndUpdateWithRetry(k8sClient client.Client, ctx context.Context, objKey client.ObjectKey, ...)
- func K8sGetWithRetry(k8sClient client.Client, ctx context.Context, instKey client.ObjectKey, ...)
- func K8sVerifyUserConnectivity(pod, ns, pdb string, userCred map[string]string)
- func PrintClusterObjects()
- func PrintENV()
- func PrintEvents()
- func PrintLogs(namespace string, env envtest.Environment, dumpLogsFor []string, ...)
- func PrintPVCs()
- func PrintPods()
- func PrintSVCs()
- func PrintSimpleDebugInfo(k8sEnv K8sOperatorEnvironment, instanceName string, CDBName string)
- func RandName(base string) string
- func RunReconcilerTestSuite(t *testing.T, k8sClient *client.Client, k8sManager *ctrl.Manager, ...)
- func SetupServiceAccountBindingBetweenGcpAndK8s(k8sEnv K8sOperatorEnvironment)
- func StoreOracleLogs(pod string, ns string, instanceName string, CDBName string) error
- func TestImageForVersion(version string, edition string, extra string) string
- func VerifySimpleData(k8sEnv K8sOperatorEnvironment)
- func WaitForInstanceConditionState(k8sEnv K8sOperatorEnvironment, key client.ObjectKey, condition string, ...)
- func WaitForObjectConditionState(k8sEnv K8sOperatorEnvironment, key client.ObjectKey, emptyObj client.Object, ...)
- type FakeClientFactory
- type FakeConfigAgentClient
- func (cli *FakeConfigAgentClient) BootstrapDatabase(context.Context, *capb.BootstrapDatabaseRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) BootstrapDatabaseCalledCnt() int
- func (cli *FakeConfigAgentClient) BootstrapStandby(context.Context, *capb.BootstrapStandbyRequest, ...grpc.CallOption) (*capb.BootstrapStandbyResponse, error)
- func (cli *FakeConfigAgentClient) BounceDatabase(context.Context, *capb.BounceDatabaseRequest, ...grpc.CallOption) (*capb.BounceDatabaseResponse, error)
- func (cli *FakeConfigAgentClient) CheckStatus(context.Context, *capb.CheckStatusRequest, ...grpc.CallOption) (*capb.CheckStatusResponse, error)
- func (cli *FakeConfigAgentClient) CreateCDB(context.Context, *capb.CreateCDBRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) CreateCDBUser(context.Context, *capb.CreateCDBUserRequest, ...grpc.CallOption) (*capb.CreateCDBUserResponse, error)
- func (cli *FakeConfigAgentClient) CreateDatabase(context.Context, *capb.CreateDatabaseRequest, ...grpc.CallOption) (*capb.CreateDatabaseResponse, error)
- func (cli *FakeConfigAgentClient) CreateListener(context.Context, *capb.CreateListenerRequest, ...grpc.CallOption) (*capb.CreateListenerResponse, error)
- func (cli *FakeConfigAgentClient) CreateUsers(context.Context, *capb.CreateUsersRequest, ...grpc.CallOption) (*capb.CreateUsersResponse, error)
- func (cli *FakeConfigAgentClient) DataPumpExport(context.Context, *capb.DataPumpExportRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) DataPumpExportCalledCnt() int
- func (cli *FakeConfigAgentClient) DataPumpImport(context.Context, *capb.DataPumpImportRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) DataPumpImportCalledCnt() int
- func (cli *FakeConfigAgentClient) DeleteOperation(context.Context, *longrunning.DeleteOperationRequest, ...grpc.CallOption) (*empty.Empty, error)
- func (cli *FakeConfigAgentClient) DeleteOperationCalledCnt() int
- func (cli *FakeConfigAgentClient) FetchServiceImageMetaData(ctx context.Context, in *capb.FetchServiceImageMetaDataRequest, ...) (*capb.FetchServiceImageMetaDataResponse, error)
- func (cli *FakeConfigAgentClient) GetOperation(context.Context, *longrunning.GetOperationRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) GetOperationCalledCnt() int
- func (cli *FakeConfigAgentClient) GetParameterTypeValue(context.Context, *capb.GetParameterTypeValueRequest, ...grpc.CallOption) (*capb.GetParameterTypeValueResponse, error)
- func (cli *FakeConfigAgentClient) ListOperations(context.Context, *longrunning.ListOperationsRequest, ...grpc.CallOption) (*longrunning.ListOperationsResponse, error)
- func (cli *FakeConfigAgentClient) NextGetOperationStatus() FakeOperationStatus
- func (cli *FakeConfigAgentClient) PhysicalBackup(context.Context, *capb.PhysicalBackupRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) PhysicalBackupCalledCnt() int
- func (cli *FakeConfigAgentClient) PhysicalRestore(context.Context, *capb.PhysicalRestoreRequest, ...grpc.CallOption) (*longrunning.Operation, error)
- func (cli *FakeConfigAgentClient) PhysicalRestoreCalledCnt() int
- func (cli *FakeConfigAgentClient) RecoverConfigFile(ctx context.Context, in *capb.RecoverConfigFileRequest, ...) (*capb.RecoverConfigFileResponse, error)
- func (cli *FakeConfigAgentClient) Reset()
- func (cli *FakeConfigAgentClient) SetAsyncBootstrapDatabase(async bool)
- func (cli *FakeConfigAgentClient) SetAsyncPhysicalBackup(async bool)
- func (cli *FakeConfigAgentClient) SetAsyncPhysicalRestore(async bool)
- func (cli *FakeConfigAgentClient) SetMethodToRespFunc(m map[string]func(interface{}) (interface{}, error))
- func (cli *FakeConfigAgentClient) SetNextGetOperationStatus(status FakeOperationStatus)
- func (cli *FakeConfigAgentClient) SetParameter(context.Context, *capb.SetParameterRequest, ...grpc.CallOption) (*capb.SetParameterResponse, error)
- func (cli *FakeConfigAgentClient) UpdateUsers(context.Context, *capb.UpdateUsersRequest, ...grpc.CallOption) (*capb.UpdateUsersResponse, error)
- func (cli *FakeConfigAgentClient) UsersChanged(context.Context, *capb.UsersChangedRequest, ...grpc.CallOption) (*capb.UsersChangedResponse, error)
- func (cli *FakeConfigAgentClient) VerifyPhysicalBackup(ctx context.Context, in *capb.VerifyPhysicalBackupRequest, ...) (*capb.VerifyPhysicalBackupResponse, error)
- func (cli *FakeConfigAgentClient) VerifyPhysicalBackupCalledCnt() int
- type FakeOperationStatus
- type K8sOperatorEnvironment
- type Reconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSimpleInstance ¶
func CreateSimpleInstance(k8sEnv K8sOperatorEnvironment, instanceName string, version string, edition string)
CreateSimpleInstance creates a basic v1alpha1.Instance object named 'instanceName'. 'version' and 'edition' should match rules of TestImageForVersion(). Depends on the Ginkgo asserts.
func CreateSimplePDB ¶
func CreateSimplePDB(k8sEnv K8sOperatorEnvironment, instanceName string)
CreateSimplePDB creates a simple PDB 'pdb1' inside 'instanceName' Instance. Depends on the Ginkgo asserts.
func CreateSimplePdbWithDbObj ¶
func CreateSimplePdbWithDbObj(k8sEnv K8sOperatorEnvironment, database *v1alpha1.Database)
CreateSimplePdbWithDbObj creates simple PDB by given database object.
func DeployOperator ¶
func DeployOperator(ctx context.Context, k8sClient client.Client, namespace string) (func() error, error)
DeployOperator deploys an operator and returns a cleanup function to delete all cluster level objects created outside of the namespace.
func GCloudServiceAccount ¶
func GCloudServiceAccount() string
GCloudServiceAccount returns the GCloud service account name.
func InsertSimpleData ¶
func InsertSimpleData(k8sEnv K8sOperatorEnvironment)
InsertSimpleData creates 'test_table' in pdb1 and inserts a test row.
func IsCanaryJob ¶
func IsCanaryJob() bool
Returns true if 'PROW_CANARY_JOB' env is set. Canary Job is supposed to host all long-running tests.
func K8sCreateAndGet ¶
func K8sCreateAndGet(k8sClient client.Client, ctx context.Context, objKey client.ObjectKey, obj client.Object, createdObj client.Object)
K8sCreateAndGet calls k8s Create() with retry and then wait for the object to be created. Updates 'createdObj' with the created object.
func K8sCreateWithRetry ¶
K8sCreateWithRetry calls k8s Create() with retry as k8s might require this in some cases (e.g. conflicts).
func K8sDeleteWithRetry ¶
K8sDeleteWithRetry calls k8s Delete() with retry as k8s might require this in some cases (e.g. conflicts).
func K8sExec ¶
K8sExec execs a command in a pod and returns a string result. Depends on the Ginkgo asserts. kubectl exec <pod> <cmd> -n <ns> -c <container>
func K8sExecuteSql ¶
K8sExecuteSql executes multiple sql statements in an Oracle pod e.g. sql := `alter session set container=pdb1; create table test_table (name varchar(100)); insert into test_table values ('Hello World'); commit;` out, err = testhelpers.K8sExecuteSql("mydb-sts-0", "db", sql) Depends on the Ginkgo asserts. Please escape any bash special characters.
func K8sExecuteSqlOrFail ¶
K8sExecuteSqlOrFail is the same as K8sExecuteSql but raises a ginkgo assert on failure.
func K8sGetAndUpdateStatusWithRetry ¶
func K8sGetAndUpdateStatusWithRetry(k8sClient client.Client, ctx context.Context, objKey client.ObjectKey, emptyObj client.Object, modifyObjectFunc func(*client.Object))
Simple helper to make the Get-Modify-UpdateStatus-Retry cycle easier Get a fresh version of the object into 'emptyObj' using 'objKey' Apply user-supplied modifyObjectFunc() which should modify the 'emptyObj' Try to update 'emptyObj' status in k8s, retry if needed
func K8sGetAndUpdateWithRetry ¶
func K8sGetAndUpdateWithRetry(k8sClient client.Client, ctx context.Context, objKey client.ObjectKey, emptyObj client.Object, modifyObjectFunc func(*client.Object))
Simple helper to make the Get-Modify-Update-Retry cycle easier Get a fresh version of the object into 'emptyObj' using 'objKey' Apply user-supplied modifyObjectFunc() which should modify the 'emptyObj' Try to update 'emptyObj' in k8s, retry if needed
func K8sGetWithRetry ¶
func K8sGetWithRetry(k8sClient client.Client, ctx context.Context, instKey client.ObjectKey, obj client.Object)
K8sGetWithRetry calls k8s Get() with retry as k8s might require this in some cases (e.g. conflicts).
func K8sVerifyUserConnectivity ¶
K8sVerifyUserConnectivity verified user connectivity on "oracledb" container. Or raise ginkgo assertion on failure. 5 retried in 30 second for each user is performed to workaround potential password sync latency between Config Server and Oracle DB.
func PrintClusterObjects ¶
func PrintClusterObjects()
Print cluster objects - events, pods, pvcs for all namespaces in the cluster
func PrintLogs ¶
func PrintLogs(namespace string, env envtest.Environment, dumpLogsFor []string, instances []string)
Print logs from requested containers
func PrintSimpleDebugInfo ¶
func PrintSimpleDebugInfo(k8sEnv K8sOperatorEnvironment, instanceName string, CDBName string)
Prints logs for a typical single-instance test scenario in case of failure: Prints logs for 'manager', 'dbdaemon', 'oracledb' containers. Prints cluster objects. Stores Oracle trace logs to a local dir (or Prow Artifacts).
func RunReconcilerTestSuite ¶
func RunReconcilerTestSuite(t *testing.T, k8sClient *client.Client, k8sManager *ctrl.Manager, description string, controllers func() []Reconciler)
RunReconcilerTestSuite runs all specs in the current package against a specialized testing environment. Before running the suite, this function configures the test environment by taking the following actions:
- Starting a control plane consisting of an etcd process and a Kubernetes API server process.
- Installing CRDs into the control plane
- Starting an in-process manager in a dedicated goroutine with the given reconcilers installed in it.
These components will be torn down after the suite runs.
func SetupServiceAccountBindingBetweenGcpAndK8s ¶
func SetupServiceAccountBindingBetweenGcpAndK8s(k8sEnv K8sOperatorEnvironment)
SetupServiceAccountBindingBetweenGcpAndK8s creates IAM policy binding between k8s service account <projectId>.svc.id.goog[<NAMESPACE>/default] and google service account.
func StoreOracleLogs ¶
StoreOracleLogs saves Oracle's trace logs from oracledb pod. Stores to $ARTIFACTS in case of a Prow job or in a temporary directory if running locally.
func TestImageForVersion ¶
TestImageForVersion returns service image for integration tests. Image paths are predefined in the env variables TEST_IMAGE_ORACLE_*.
func VerifySimpleData ¶
func VerifySimpleData(k8sEnv K8sOperatorEnvironment)
VerifySimpleData checks that the test row in 'pdb1' exists.
func WaitForInstanceConditionState ¶
func WaitForInstanceConditionState(k8sEnv K8sOperatorEnvironment, key client.ObjectKey, condition string, targetStatus metav1.ConditionStatus, targetReason string, timeout time.Duration)
WaitForInstanceConditionState waits until the Instance condition object status = targetStatus and reason = targetReason. Depends on the Ginkgo asserts.
func WaitForObjectConditionState ¶
func WaitForObjectConditionState(k8sEnv K8sOperatorEnvironment, key client.ObjectKey, emptyObj client.Object, condition string, targetStatus metav1.ConditionStatus, targetReason string, timeout time.Duration)
WaitForObjectConditionState waits until the k8s object condition object status = targetStatus and reason = targetReason. Objects supported: v1alpha1. {Instance, Import, Export} Depends on the Ginkgo asserts.
Types ¶
type FakeClientFactory ¶
type FakeClientFactory struct {
Caclient *FakeConfigAgentClient
}
FakeClientFactory is a simple factory to create our FakeConfigAgentClient.
func (*FakeClientFactory) New ¶
func (g *FakeClientFactory) New(context.Context, client.Reader, string, string) (capb.ConfigAgentClient, controllers.ConnCloseFunc, error)
New returns a new fake ConfigAgent.
func (*FakeClientFactory) Reset ¶
func (g *FakeClientFactory) Reset()
Reset clears the inner ConfigAgent.
type FakeConfigAgentClient ¶
type FakeConfigAgentClient struct {
// contains filtered or unexported fields
}
FakeConfigAgentClient a client for capturing calls the various ConfigAgent api.
func (*FakeConfigAgentClient) BootstrapDatabase ¶
func (cli *FakeConfigAgentClient) BootstrapDatabase(context.Context, *capb.BootstrapDatabaseRequest, ...grpc.CallOption) (*longrunning.Operation, error)
BootstrapDatabase wrapper.
func (*FakeConfigAgentClient) BootstrapDatabaseCalledCnt ¶
func (cli *FakeConfigAgentClient) BootstrapDatabaseCalledCnt() int
BootstrapDatabaseCalledCnt returns call count.
func (*FakeConfigAgentClient) BootstrapStandby ¶
func (cli *FakeConfigAgentClient) BootstrapStandby(context.Context, *capb.BootstrapStandbyRequest, ...grpc.CallOption) (*capb.BootstrapStandbyResponse, error)
BootstrapStandby wrapper.
func (*FakeConfigAgentClient) BounceDatabase ¶
func (cli *FakeConfigAgentClient) BounceDatabase(context.Context, *capb.BounceDatabaseRequest, ...grpc.CallOption) (*capb.BounceDatabaseResponse, error)
BounceDatabase wrapper.
func (*FakeConfigAgentClient) CheckStatus ¶
func (cli *FakeConfigAgentClient) CheckStatus(context.Context, *capb.CheckStatusRequest, ...grpc.CallOption) (*capb.CheckStatusResponse, error)
CheckStatus wrapper.
func (*FakeConfigAgentClient) CreateCDB ¶
func (cli *FakeConfigAgentClient) CreateCDB(context.Context, *capb.CreateCDBRequest, ...grpc.CallOption) (*longrunning.Operation, error)
CreateCDB wrapper.
func (*FakeConfigAgentClient) CreateCDBUser ¶
func (cli *FakeConfigAgentClient) CreateCDBUser(context.Context, *capb.CreateCDBUserRequest, ...grpc.CallOption) (*capb.CreateCDBUserResponse, error)
CreateCDBUser wrapper.
func (*FakeConfigAgentClient) CreateDatabase ¶
func (cli *FakeConfigAgentClient) CreateDatabase(context.Context, *capb.CreateDatabaseRequest, ...grpc.CallOption) (*capb.CreateDatabaseResponse, error)
CreateDatabase wrapper.
func (*FakeConfigAgentClient) CreateListener ¶
func (cli *FakeConfigAgentClient) CreateListener(context.Context, *capb.CreateListenerRequest, ...grpc.CallOption) (*capb.CreateListenerResponse, error)
CreateListener wrapper.
func (*FakeConfigAgentClient) CreateUsers ¶
func (cli *FakeConfigAgentClient) CreateUsers(context.Context, *capb.CreateUsersRequest, ...grpc.CallOption) (*capb.CreateUsersResponse, error)
CreateUsers wrapper.
func (*FakeConfigAgentClient) DataPumpExport ¶
func (cli *FakeConfigAgentClient) DataPumpExport(context.Context, *capb.DataPumpExportRequest, ...grpc.CallOption) (*longrunning.Operation, error)
DataPumpExport wrapper.
func (*FakeConfigAgentClient) DataPumpExportCalledCnt ¶
func (cli *FakeConfigAgentClient) DataPumpExportCalledCnt() int
DataPumpExportCalledCnt returns call count.
func (*FakeConfigAgentClient) DataPumpImport ¶
func (cli *FakeConfigAgentClient) DataPumpImport(context.Context, *capb.DataPumpImportRequest, ...grpc.CallOption) (*longrunning.Operation, error)
DataPumpImport wrapper.
func (*FakeConfigAgentClient) DataPumpImportCalledCnt ¶
func (cli *FakeConfigAgentClient) DataPumpImportCalledCnt() int
DataPumpImportCalledCnt returns call count.
func (*FakeConfigAgentClient) DeleteOperation ¶
func (cli *FakeConfigAgentClient) DeleteOperation(context.Context, *longrunning.DeleteOperationRequest, ...grpc.CallOption) (*empty.Empty, error)
DeleteOperation wrapper.
func (*FakeConfigAgentClient) DeleteOperationCalledCnt ¶
func (cli *FakeConfigAgentClient) DeleteOperationCalledCnt() int
DeleteOperationCalledCnt returns call count.
func (*FakeConfigAgentClient) FetchServiceImageMetaData ¶
func (cli *FakeConfigAgentClient) FetchServiceImageMetaData(ctx context.Context, in *capb.FetchServiceImageMetaDataRequest, opts ...grpc.CallOption) (*capb.FetchServiceImageMetaDataResponse, error)
func (*FakeConfigAgentClient) GetOperation ¶
func (cli *FakeConfigAgentClient) GetOperation(context.Context, *longrunning.GetOperationRequest, ...grpc.CallOption) (*longrunning.Operation, error)
GetOperation wrapper.
func (*FakeConfigAgentClient) GetOperationCalledCnt ¶
func (cli *FakeConfigAgentClient) GetOperationCalledCnt() int
GetOperationCalledCnt returns call count.
func (*FakeConfigAgentClient) GetParameterTypeValue ¶
func (cli *FakeConfigAgentClient) GetParameterTypeValue(context.Context, *capb.GetParameterTypeValueRequest, ...grpc.CallOption) (*capb.GetParameterTypeValueResponse, error)
GetParameterTypeValue wrapper.
func (*FakeConfigAgentClient) ListOperations ¶
func (cli *FakeConfigAgentClient) ListOperations(context.Context, *longrunning.ListOperationsRequest, ...grpc.CallOption) (*longrunning.ListOperationsResponse, error)
ListOperations wrapper.
func (*FakeConfigAgentClient) NextGetOperationStatus ¶
func (cli *FakeConfigAgentClient) NextGetOperationStatus() FakeOperationStatus
func (*FakeConfigAgentClient) PhysicalBackup ¶
func (cli *FakeConfigAgentClient) PhysicalBackup(context.Context, *capb.PhysicalBackupRequest, ...grpc.CallOption) (*longrunning.Operation, error)
PhysicalBackup wrapper.
func (*FakeConfigAgentClient) PhysicalBackupCalledCnt ¶
func (cli *FakeConfigAgentClient) PhysicalBackupCalledCnt() int
PhysicalBackupCalledCnt returns call count.
func (*FakeConfigAgentClient) PhysicalRestore ¶
func (cli *FakeConfigAgentClient) PhysicalRestore(context.Context, *capb.PhysicalRestoreRequest, ...grpc.CallOption) (*longrunning.Operation, error)
PhysicalRestore wrapper.
func (*FakeConfigAgentClient) PhysicalRestoreCalledCnt ¶
func (cli *FakeConfigAgentClient) PhysicalRestoreCalledCnt() int
PhysicalRestoreCalledCnt returns call count.
func (*FakeConfigAgentClient) RecoverConfigFile ¶
func (cli *FakeConfigAgentClient) RecoverConfigFile(ctx context.Context, in *capb.RecoverConfigFileRequest, opts ...grpc.CallOption) (*capb.RecoverConfigFileResponse, error)
RecoverConfigFile wrapper.
func (*FakeConfigAgentClient) Reset ¶
func (cli *FakeConfigAgentClient) Reset()
Reset reset's the config agent's counters.
func (*FakeConfigAgentClient) SetAsyncBootstrapDatabase ¶
func (cli *FakeConfigAgentClient) SetAsyncBootstrapDatabase(async bool)
func (*FakeConfigAgentClient) SetAsyncPhysicalBackup ¶
func (cli *FakeConfigAgentClient) SetAsyncPhysicalBackup(async bool)
func (*FakeConfigAgentClient) SetAsyncPhysicalRestore ¶
func (cli *FakeConfigAgentClient) SetAsyncPhysicalRestore(async bool)
func (*FakeConfigAgentClient) SetMethodToRespFunc ¶
func (cli *FakeConfigAgentClient) SetMethodToRespFunc(m map[string]func(interface{}) (interface{}, error))
func (*FakeConfigAgentClient) SetNextGetOperationStatus ¶
func (cli *FakeConfigAgentClient) SetNextGetOperationStatus(status FakeOperationStatus)
func (*FakeConfigAgentClient) SetParameter ¶
func (cli *FakeConfigAgentClient) SetParameter(context.Context, *capb.SetParameterRequest, ...grpc.CallOption) (*capb.SetParameterResponse, error)
SetParameter wrapper.
func (*FakeConfigAgentClient) UpdateUsers ¶
func (cli *FakeConfigAgentClient) UpdateUsers(context.Context, *capb.UpdateUsersRequest, ...grpc.CallOption) (*capb.UpdateUsersResponse, error)
UpdateUsers wrapper.
func (*FakeConfigAgentClient) UsersChanged ¶
func (cli *FakeConfigAgentClient) UsersChanged(context.Context, *capb.UsersChangedRequest, ...grpc.CallOption) (*capb.UsersChangedResponse, error)
UsersChanged wrapper.
func (*FakeConfigAgentClient) VerifyPhysicalBackup ¶
func (cli *FakeConfigAgentClient) VerifyPhysicalBackup(ctx context.Context, in *capb.VerifyPhysicalBackupRequest, opts ...grpc.CallOption) (*capb.VerifyPhysicalBackupResponse, error)
VerifyPhysicalBackup wrapper.
func (*FakeConfigAgentClient) VerifyPhysicalBackupCalledCnt ¶
func (cli *FakeConfigAgentClient) VerifyPhysicalBackupCalledCnt() int
VerifyPhysicalBackupCalledCnt returns call count.
type FakeOperationStatus ¶
type FakeOperationStatus int32
FakeOperationStatus is an enum type for LRO statuses managed by FakeConfigAgentClient.
const ( //StatusUndefined undefined. StatusUndefined FakeOperationStatus = iota //StatusRunning running. StatusRunning //StatusDone done. StatusDone //StatusDoneWithError done with error. StatusDoneWithError //StatusNotFound not found. StatusNotFound )
type K8sOperatorEnvironment ¶
type K8sOperatorEnvironment struct {
Env envtest.Environment
Namespace string
Ctx context.Context
K8sClient client.Client
OperCleanup func() error // Operator deployment cleanup callback.
TestFailed bool // If true then dump container logs.
K8sServiceAccount string
}
K8sOperatorEnvironment is a helper for integration testing.
Encapsulates all necessary variables to work with the test cluster Can be created/destroyed multiple times within one test suite Depends on the Ginkgo asserts Example usage:
// Global variable, to be accessible by AfterSuite. var k8sEnv = testhelpers.K8sEnvironment{} // In case of Ctrl-C, clean up the last valid k8sEnv.
AfterSuite(func() {
k8sEnv.Close()
})
...
BeforeEach(func() {
k8sEnv.Init(testhelpers.RandName("k8s-env-stress-test"))
})
AfterEach(func() {
k8sEnv.Close()
})
func (*K8sOperatorEnvironment) Close ¶
func (k8sEnv *K8sOperatorEnvironment) Close()
Close cleans cluster objects and uninstalls operator.
func (*K8sOperatorEnvironment) Init ¶
func (k8sEnv *K8sOperatorEnvironment) Init(namespace string)
Init the environment, install CRDs, deploy operator, create 'namespace'.
type Reconciler ¶
Reconciler is the interface to setup a reconciler for testing.