framework

package
v0.7.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Overview

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	MINIO_PUBLIC_CRT_NAME  = "public.crt"
	MINIO_PRIVATE_KEY_NAME = "private.key"

	MINIO_ACCESS_KEY_ID     = "not@id"
	MINIO_SECRET_ACCESS_KEY = "not@secret"

	MINIO_CERTS_MOUNTPATH = "/root/.minio/certs"
	StandardStorageClass  = "standard"

	MinioServer       = "minio-server"
	MinioServerSecret = "minio-server-secret"
	MinioPVCStorage   = "minio-pvc-storage"
	MinioService      = "minio-service"
	LocalHostIP       = "127.0.0.1"
)
View Source
const (
	GET                = "get"
	LIST               = "list"
	PATCH              = "patch"
	CREATE             = "create"
	UPDATE             = "update"
	USE                = "use"
	POLICY             = "policy"
	Role               = "Role"
	ServiceAccount     = "ServiceAccount"
	CustomSecretSuffix = "custom-secret"
	KeyMongoDBUser     = "username"
	KeyMongoDBPassword = "password"
)
View Source
const (
	StorageProviderGCS   = "gcs"
	StorageProviderAzure = "azure"
	StorageProviderS3    = "s3"
	StorageProviderMinio = "minio"
	StorageProviderSwift = "swift"
)
View Source
const (
	IssuerName = "e2e-self-signed-issuer"
)

Variables

View Source
var (
	DockerRegistry  = "kubedbci"
	DBCatalogName   = "4.1.13-v1"
	StorageProvider string
)
View Source
var (
	JobPvcStorageSize = "2Gi"
	DBPvcStorageSize  = "1Gi"
)

Functions

func ClusterAuthModeP

func ClusterAuthModeP(v api.ClusterAuthMode) *api.ClusterAuthMode

ClusterAuthModeP returns a pointer to the int32 value passed in.

func IsRepSet

func IsRepSet(db *api.MongoDB) bool

func SSLModeP

func SSLModeP(v api.SSLMode) *api.SSLMode

SSLModeP returns a pointer to the int32 value passed in.

Types

type Framework

type Framework struct {
	StorageClass string
	CertStore    *certstore.CertStore
	// contains filtered or unexported fields
}

func New

func New(
	restConfig *rest.Config,
	kubeClient kubernetes.Interface,
	apiExtKubeClient crd_cs.ApiextensionsV1beta1Interface,
	dbClient cs.Interface,
	kaClient ka.Interface,
	appCatalogClient appcat_cs.AppcatalogV1alpha1Interface,
	stashClient scs.Interface,
	storageClass string,
	certManagerClient cm.Interface,
) (*Framework, error)

func (*Framework) AddMonitor

func (f *Framework) AddMonitor(obj *api.MongoDB)

func (*Framework) CheckAppBindingSpec

func (f *Framework) CheckAppBindingSpec(meta metav1.ObjectMeta) error

func (*Framework) CheckSecret

func (f *Framework) CheckSecret(secret *core.Secret) error

func (*Framework) CleanMongoDB

func (f *Framework) CleanMongoDB()

func (*Framework) CleanWorkloadLeftOvers

func (f *Framework) CleanWorkloadLeftOvers()

func (*Framework) ConnectAndPing

func (f *Framework) ConnectAndPing(meta metav1.ObjectMeta, clientPodName string, isReplSet ...bool) (*mongo.Client, *portforward.Tunnel, error)

func (*Framework) CreateBackupConfiguration

func (f *Framework) CreateBackupConfiguration(backupCfg *stashv1beta1.BackupConfiguration) error

func (*Framework) CreateDeploymentForMinioServer

func (f *Framework) CreateDeploymentForMinioServer(obj apps.Deployment) error

func (*Framework) CreateIssuer

func (f *Framework) CreateIssuer(obj *cm_api.Issuer) error

func (*Framework) CreateMinioServer

func (f *Framework) CreateMinioServer(tls bool, ips []net.IP) (string, error)

func (*Framework) CreateNamespace

func (f *Framework) CreateNamespace() error

func (*Framework) CreatePersistentVolumeClaimForMinioServer

func (f *Framework) CreatePersistentVolumeClaimForMinioServer(obj core.PersistentVolumeClaim) error

func (*Framework) CreateRepository

func (f *Framework) CreateRepository(repo *stashV1alpha1.Repository) error

func (*Framework) CreateRestoreSession

func (f *Framework) CreateRestoreSession(restoreSession *stashv1beta1.RestoreSession) error

func (*Framework) CreateRole

func (f *Framework) CreateRole(obj *rbac.Role) error

func (*Framework) CreateRoleBinding

func (f *Framework) CreateRoleBinding(obj *rbac.RoleBinding) error

func (*Framework) CreateSecret

func (f *Framework) CreateSecret(obj *core.Secret) error

func (*Framework) CreateServiceAccount

func (f *Framework) CreateServiceAccount(obj *core.ServiceAccount) error

func (*Framework) CreateServiceForMinioServer

func (f *Framework) CreateServiceForMinioServer(obj core.Service) (*core.Service, error)

func (*Framework) DeleteAppBinding

func (f *Framework) DeleteAppBinding(meta metav1.ObjectMeta) error

DeleteAppBinding deletes the custom appBinding that is created in test

func (*Framework) DeleteBackupConfiguration

func (f *Framework) DeleteBackupConfiguration(meta metav1.ObjectMeta) error

func (*Framework) DeleteCASecret

func (f *Framework) DeleteCASecret(clientCASecret *v1.Secret)

func (*Framework) DeleteConfigMap

func (f *Framework) DeleteConfigMap(meta metav1.ObjectMeta) error

func (*Framework) DeleteDeploymentForMinioServer

func (f *Framework) DeleteDeploymentForMinioServer(meta metav1.ObjectMeta) error

func (*Framework) DeleteGarbageCASecrets

func (f *Framework) DeleteGarbageCASecrets(secretList []*v1.Secret)

func (*Framework) DeleteIssuer

func (f *Framework) DeleteIssuer(meta metav1.ObjectMeta) error

func (*Framework) DeleteMinioServer

func (f *Framework) DeleteMinioServer() error

func (*Framework) DeleteMongoDB

func (f *Framework) DeleteMongoDB(meta metav1.ObjectMeta) error

func (*Framework) DeleteNamespace

func (f *Framework) DeleteNamespace() error

func (*Framework) DeletePVCForMinioServer

func (f *Framework) DeletePVCForMinioServer(meta metav1.ObjectMeta) error

func (*Framework) DeleteRepository

func (f *Framework) DeleteRepository(meta metav1.ObjectMeta) error

func (Framework) DeleteRestoreSession

func (f Framework) DeleteRestoreSession(meta metav1.ObjectMeta) error

func (*Framework) DeleteSecret

func (f *Framework) DeleteSecret(meta metav1.ObjectMeta) error

func (*Framework) DeleteSecretForMinioServer

func (f *Framework) DeleteSecretForMinioServer(meta metav1.ObjectMeta) error

func (*Framework) DeleteServiceForMinioServer

func (f *Framework) DeleteServiceForMinioServer(meta metav1.ObjectMeta) error

func (*Framework) DeploymentForMinioServer

func (f *Framework) DeploymentForMinioServer() apps.Deployment

func (*Framework) EnsureCustomAppBinding

func (f *Framework) EnsureCustomAppBinding(db *api.MongoDB, customAppBindingName string) error

EnsureCustomAppBinding creates custom Appbinding for mongodb. In this custom appbinding, all fields are similar to actual appbinding object, except Spec.Parameters.

func (*Framework) EventuallyAppBinding

func (f *Framework) EventuallyAppBinding(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyCRD

func (f *Framework) EventuallyCRD() GomegaAsyncAssertion

func (*Framework) EventuallyCollectionPartitioned

func (f *Framework) EventuallyCollectionPartitioned(meta metav1.ObjectMeta, dbName string) GomegaAsyncAssertion

EventuallyCollectionPartitioned checks if a database is partitioned or not. Call this only when spec.shardTopology is set.

func (*Framework) EventuallyDBSecretCount

func (f *Framework) EventuallyDBSecretCount(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyDocumentExists

func (f *Framework) EventuallyDocumentExists(meta metav1.ObjectMeta, dbName string, collectionCount int) GomegaAsyncAssertion

func (*Framework) EventuallyEnableSharding

func (f *Framework) EventuallyEnableSharding(meta metav1.ObjectMeta, dbName string) GomegaAsyncAssertion

EventuallyEnableSharding enables sharding of a database. Call this only when spec.shardTopology is set.

func (*Framework) EventuallyInsertDocument

func (f *Framework) EventuallyInsertDocument(meta metav1.ObjectMeta, dbName string, collectionCount int) GomegaAsyncAssertion

func (*Framework) EventuallyMaxIncomingConnections

func (f *Framework) EventuallyMaxIncomingConnections(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyMongoDB

func (f *Framework) EventuallyMongoDB(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyMongoDBPhase

func (f *Framework) EventuallyMongoDBPhase(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyMongoDBRunning

func (f *Framework) EventuallyMongoDBRunning(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyPVCCount

func (f *Framework) EventuallyPVCCount(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyPingMongo

func (f *Framework) EventuallyPingMongo(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyRestoreSessionPhase

func (f *Framework) EventuallyRestoreSessionPhase(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallySnapshotInRepository

func (f *Framework) EventuallySnapshotInRepository(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EventuallyUserSSLSettings

func (f *Framework) EventuallyUserSSLSettings(meta metav1.ObjectMeta, clusterAuthMode *v1alpha1.ClusterAuthMode, sslMode *v1alpha1.SSLMode) GomegaAsyncAssertion

func (*Framework) EventuallyWipedOut

func (f *Framework) EventuallyWipedOut(meta metav1.ObjectMeta) GomegaAsyncAssertion

func (*Framework) EvictPodsFromDeployment

func (f *Framework) EvictPodsFromDeployment(meta metav1.ObjectMeta) error

func (*Framework) EvictPodsFromStatefulSet

func (f *Framework) EvictPodsFromStatefulSet(meta metav1.ObjectMeta) error

func (*Framework) ForwardPort

func (f *Framework) ForwardPort(meta metav1.ObjectMeta, clientPodName string) (*portforward.Tunnel, error)

func (*Framework) ForwardToPort

func (f *Framework) ForwardToPort(meta metav1.ObjectMeta, clientPodName string, port *int) (*portforward.Tunnel, error)

func (*Framework) FoundStashCRDs

func (f *Framework) FoundStashCRDs() bool

func (*Framework) GetMinioServiceName

func (f *Framework) GetMinioServiceName() string

func (*Framework) GetMongoDB

func (f *Framework) GetMongoDB(meta metav1.ObjectMeta) (*api.MongoDB, error)

func (*Framework) GetMongoDBClient

func (f *Framework) GetMongoDBClient(meta metav1.ObjectMeta, tunnel *portforward.Tunnel, isReplSet ...bool) (*options.ClientOptions, error)

func (*Framework) GetMongoDBRootPassword

func (f *Framework) GetMongoDBRootPassword(mongodb *api.MongoDB) (string, error)

func (*Framework) GetMongoDBVersion

func (f *Framework) GetMongoDBVersion(name string) (*v1alpha1.MongoDBVersion, error)

func (*Framework) GetMongosPodName

func (f *Framework) GetMongosPodName(meta metav1.ObjectMeta) (string, error)

func (*Framework) GetPrimaryInstance

func (f *Framework) GetPrimaryInstance(meta metav1.ObjectMeta) (string, error)

func (*Framework) GetReplicaMasterNode

func (f *Framework) GetReplicaMasterNode(meta metav1.ObjectMeta, nodeName string, replicaNumber *int32) (string, error)

func (*Framework) GetSSLCertificate

func (f *Framework) GetSSLCertificate(meta metav1.ObjectMeta) error

GetSSLCertificate gets ssl certificate of mongodb and creates a client certificate in certPath

func (*Framework) Invoke

func (f *Framework) Invoke() *Invocation

func (*Framework) IssuerForMongoDB

func (f *Framework) IssuerForMongoDB(mgoMeta, caSecretMeta metav1.ObjectMeta) *cm_api.Issuer

func (*Framework) MinioServerSANs

func (f *Framework) MinioServerSANs(ips []net.IP) cert.AltNames

func (*Framework) MinioServiceAddres

func (f *Framework) MinioServiceAddres() string

func (*Framework) Namespace

func (f *Framework) Namespace() string

func (*Framework) PVCForMinioServer

func (f *Framework) PVCForMinioServer() core.PersistentVolumeClaim

func (*Framework) PatchMongoDB

func (f *Framework) PatchMongoDB(meta metav1.ObjectMeta, transform func(*api.MongoDB) *api.MongoDB) (*api.MongoDB, error)

func (*Framework) PauseBackupConfiguration

func (f *Framework) PauseBackupConfiguration(meta metav1.ObjectMeta) error

func (*Framework) PrintDebugHelpers

func (f *Framework) PrintDebugHelpers()

func (*Framework) RemoveSecretVolumeMount

func (f *Framework) RemoveSecretVolumeMount(containers []core.Container) []core.Container

func (*Framework) SecretForMinioServer

func (f *Framework) SecretForMinioServer(ips []net.IP) core.Secret

func (*Framework) SelfSignedCASecret

func (f *Framework) SelfSignedCASecret(meta metav1.ObjectMeta) *v1.Secret

func (*Framework) ServiceForMinioServer

func (f *Framework) ServiceForMinioServer() core.Service

func (*Framework) UpdateIssuer

func (f *Framework) UpdateIssuer(meta metav1.ObjectMeta, transformer func(cm_api.Issuer) cm_api.Issuer) error

func (*Framework) UpdateSecret

func (f *Framework) UpdateSecret(meta metav1.ObjectMeta, transformer func(core.Secret) core.Secret) error

func (*Framework) VerifyExporter

func (f *Framework) VerifyExporter(meta metav1.ObjectMeta) error

VerifyExporter uses metrics from given URL and check against known key and value to verify the connection is functioning as intended

func (*Framework) VerifyShardExporters

func (f *Framework) VerifyShardExporters(meta metav1.ObjectMeta) error

type Invocation

type Invocation struct {
	*Framework
	// contains filtered or unexported fields
}

func (*Invocation) BackupConfiguration

func (i *Invocation) BackupConfiguration(dbMeta metav1.ObjectMeta, repo *stashV1alpha1.Repository) *stashv1beta1.BackupConfiguration

func (*Invocation) ConfigMapForInitialization

func (i *Invocation) ConfigMapForInitialization() *core.ConfigMap

func (*Invocation) CreateConfigMap

func (i *Invocation) CreateConfigMap(obj *core.ConfigMap) error

func (*Invocation) CreateMongoDB

func (i *Invocation) CreateMongoDB(obj *api.MongoDB) error

func (*Invocation) CreatePersistentVolumeClaim

func (i *Invocation) CreatePersistentVolumeClaim(pvc *core.PersistentVolumeClaim) error

func (*Invocation) DBClient

func (i *Invocation) DBClient() cs.Interface

func (*Invocation) DeletePersistentVolumeClaim

func (i *Invocation) DeletePersistentVolumeClaim(meta metav1.ObjectMeta) error

func (*Invocation) GetCustomConfig

func (i *Invocation) GetCustomConfig(configs []string) *core.ConfigMap

func (*Invocation) GetPersistentVolumeClaim

func (i *Invocation) GetPersistentVolumeClaim() *core.PersistentVolumeClaim

func (*Invocation) MongoDBRS

func (i *Invocation) MongoDBRS() *api.MongoDB

func (*Invocation) MongoDBShard

func (i *Invocation) MongoDBShard() *api.MongoDB

func (*Invocation) MongoDBStandalone

func (i *Invocation) MongoDBStandalone() *api.MongoDB

func (*Invocation) MongoDBWithFlexibleProbeTimeout

func (i *Invocation) MongoDBWithFlexibleProbeTimeout(db *api.MongoDB) *api.MongoDB

func (*Invocation) PatchSecretForRestic

func (i *Invocation) PatchSecretForRestic(secret *core.Secret) *core.Secret

func (*Invocation) Repository

func (i *Invocation) Repository(dbMeta metav1.ObjectMeta, secretName string) *stashV1alpha1.Repository

func (*Invocation) RestoreSession

func (*Invocation) RoleBinding

func (i *Invocation) RoleBinding(saName string, roleName string) *rbac.RoleBinding

func (*Invocation) RoleForMongoDB

func (i *Invocation) RoleForMongoDB(meta metav1.ObjectMeta) *rbac.Role

func (*Invocation) RoleForSnapshot

func (i *Invocation) RoleForSnapshot(meta metav1.ObjectMeta) *rbac.Role

func (*Invocation) SecretForBackend

func (i *Invocation) SecretForBackend() *core.Secret

func (*Invocation) SecretForDatabaseAuthentication

func (i *Invocation) SecretForDatabaseAuthentication(meta metav1.ObjectMeta, mangedByKubeDB bool) *core.Secret

func (*Invocation) ServiceAccount

func (i *Invocation) ServiceAccount() *core.ServiceAccount

type KubedbTable

type KubedbTable struct {
	FirstName string
	LastName  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL