framework

package
v0.14.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: 60 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.

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 = "MINIO_ACCESS_KEY"
	MINIO_SECRET_KEY = "MINIO_SECRET_KEY"

	AWS_ACCESS_KEY_ID     = "AWS_ACCESS_KEY_ID"
	AWS_SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY"

	MINIO_CERTS_MOUNTPATH = "/root/.minio/certs"
	MinioSecretHTTP       = "minio-secret-http"
	MinioSecretHTTPS      = "minio-secret-https"
	MinioPVC              = "minio-pv-claim"
	MinioServiceHTTP      = "minio-service-http"
	MinioServiceHTTPS     = "minio-service-https"
	MinioServerHTTP       = "minio-http"
	MinioServerHTTPS      = "minio-https"
	PORT                  = 443
	S3_BUCKET_NAME        = "S3_BUCKET_NAME"
)
View Source
const (
	GET    = "get"
	LIST   = "list"
	PATCH  = "patch"
	CREATE = "create"
	UPDATE = "update"
	DELETE = "delete"
	USE    = "use"

	APPS           = "apps"
	POLICY         = "policy"
	Role           = "Role"
	ServiceAccount = "ServiceAccount"
)

Variables

View Source
var (
	DockerRegistry = "kubedbci"
	DBCatalogName  = "10.2-v5"
)
View Source
var (
	MinioTLS bool

	MinioService = ""
)
View Source
var (
	JobPvcStorageSize = "2Gi"
	DBPvcStorageSize  = "1Gi"
)
View Source
var (
	CustomSecretSuffix = "custom-secret"
	CustomUsername     = "username1234567890"
	CustomPassword     = "password0987654321"
)

Functions

This section is empty.

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,
) *Framework

func (*Framework) CheckAppBindingSpec

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

func (*Framework) CheckPostgres

func (f *Framework) CheckPostgres(db *xorm.Engine) error

func (*Framework) CheckSecret

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

func (*Framework) CleanPostgres

func (f *Framework) CleanPostgres()

func (*Framework) CleanWorkloadLeftOvers

func (f *Framework) CleanWorkloadLeftOvers()

func (*Framework) CreateBackupConfiguration

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

func (*Framework) CreateNamespace

func (f *Framework) CreateNamespace() error

func (*Framework) CreatePostgres

func (f *Framework) CreatePostgres(obj *api.Postgres) 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) DeleteBackupConfiguration

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

func (*Framework) DeleteConfigMap

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

func (*Framework) DeleteDeploymentForMinioServer

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

func (*Framework) DeleteNamespace

func (f *Framework) DeleteNamespace() error

func (*Framework) DeletePostgres

func (f *Framework) DeletePostgres(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) DeleteRoleBinding

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

func (*Framework) DeleteSecret

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

func (*Framework) DeleteServiceForMinioServer

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

func (*Framework) EventuallyAppBinding

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

func (*Framework) EventuallyCRD

func (f *Framework) EventuallyCRD() GomegaAsyncAssertion

func (*Framework) EventuallyCountArchive

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

func (*Framework) EventuallyCountTable

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

func (*Framework) EventuallyCreateSchema

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

func (*Framework) EventuallyCreateTable

func (f *Framework) EventuallyCreateTable(meta metav1.ObjectMeta, dbName string, userName string, total int) GomegaAsyncAssertion

func (*Framework) EventuallyDBSecretCount

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

func (*Framework) EventuallyPGSettings

func (f *Framework) EventuallyPGSettings(meta metav1.ObjectMeta, dbName string, userName string, config string) GomegaAsyncAssertion

func (*Framework) EventuallyPVCCount

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

func (*Framework) EventuallyPingDatabase

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

func (*Framework) EventuallyPostgres

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

func (*Framework) EventuallyPostgresPhase

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

func (*Framework) EventuallyPostgresPodCount

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

func (*Framework) EventuallyPostgresRunning

func (f *Framework) EventuallyPostgresRunning(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) EventuallyWalDataFound

func (f *Framework) EventuallyWalDataFound(postgres *api.Postgres) GomegaAsyncAssertion

func (*Framework) EventuallyWipedOut

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

func (*Framework) EvictPodsFromStatefulSet

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

func (*Framework) ForwardMinioPort

func (f *Framework) ForwardMinioPort(clientPodName string) (*portforward.Tunnel, error)

func (*Framework) ForwardPort

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

func (*Framework) FoundStashCRDs

func (f *Framework) FoundStashCRDs() bool

func (*Framework) GetMinioPortForwardingEndPoint

func (f *Framework) GetMinioPortForwardingEndPoint() (*portforward.Tunnel, error)

func (*Framework) GetPostgres

func (f *Framework) GetPostgres(meta metav1.ObjectMeta) (*api.Postgres, error)

func (*Framework) GetPostgresClient

func (f *Framework) GetPostgresClient(tunnel *portforward.Tunnel, dbName string, userName string) (*xorm.Engine, error)

func (*Framework) Invoke

func (f *Framework) Invoke() *Invocation

func (*Framework) IsMinio

func (f *Framework) IsMinio(backend *v1.Backend) bool

func (*Framework) IsTLS

func (f *Framework) IsTLS() bool

func (*Framework) Namespace

func (f *Framework) Namespace() string

func (*Framework) PatchPostgres

func (f *Framework) PatchPostgres(meta metav1.ObjectMeta, transform func(postgres *api.Postgres) *api.Postgres) (*api.Postgres, error)

func (*Framework) PauseBackupConfiguration

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

func (*Framework) PrintDebugHelpers

func (f *Framework) PrintDebugHelpers()

func (*Framework) Repository

func (f *Framework) Repository(dbMeta metav1.ObjectMeta) *stashV1alpha1.Repository

func (*Framework) UpdateSecret

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

type Invocation

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

func (*Invocation) App

func (i *Invocation) App() string

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) CreateBucket

func (i *Invocation) CreateBucket(deployment *apps.Deployment, minioBackendSecret *core.Secret, tls bool) error

func (*Invocation) CreateConfigMap

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

func (*Invocation) CreateDeploymentForMinioServer

func (i *Invocation) CreateDeploymentForMinioServer(obj *apps.Deployment) (*apps.Deployment, error)

func (*Invocation) CreateHTTPMinioServer

func (i *Invocation) CreateHTTPMinioServer(minioBackendSecret *core.Secret) error

func (*Invocation) CreateHTTPSMinioServer

func (i *Invocation) CreateHTTPSMinioServer(minioBackendSecret *core.Secret) error

func (*Invocation) CreateMinioBucket

func (i *Invocation) CreateMinioBucket(bucketName string, minioBackendSecret *core.Secret, endPoint string) error

func (*Invocation) CreateMinioServer

func (i *Invocation) CreateMinioServer(tls bool, ips []net.IP, minioBackendSecret *core.Secret) (string, error)

func (*Invocation) CreatePersistentVolumeClaim

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

func (*Invocation) CreateService

func (i *Invocation) CreateService(obj core.Service) (*core.Service, error)

func (*Invocation) DeleteMinioServer

func (i *Invocation) DeleteMinioServer()

func (*Invocation) DeletePersistentVolumeClaim

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

func (*Invocation) ExtClient

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

func (*Invocation) GetCustomConfig

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

func (*Invocation) GetNamedPersistentVolumeClaim

func (i *Invocation) GetNamedPersistentVolumeClaim(name string) *core.PersistentVolumeClaim

func (*Invocation) GetPersistentVolumeClaim

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

func (*Invocation) MinioServerDeploymentHTTP

func (i *Invocation) MinioServerDeploymentHTTP() *apps.Deployment

func (*Invocation) MinioServerDeploymentHTTPS

func (i *Invocation) MinioServerDeploymentHTTPS(tls bool) *apps.Deployment

func (*Invocation) MinioServerSANs

func (i *Invocation) MinioServerSANs() cert.AltNames

func (*Invocation) MinioServiceAddress

func (i *Invocation) MinioServiceAddress() string

func (*Invocation) PatchSecretForRestic

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

func (*Invocation) Postgres

func (i *Invocation) Postgres() *api.Postgres

func (*Invocation) RestoreSession

func (*Invocation) RoleBinding

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

func (*Invocation) RoleForPostgres

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

func (*Invocation) RoleForSnapshot

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

func (*Invocation) SecretForAzureBackend

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

func (*Invocation) SecretForDatabaseAuthentication

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

func (*Invocation) SecretForDatabaseAuthenticationWithLabel

func (i *Invocation) SecretForDatabaseAuthenticationWithLabel(meta metav1.ObjectMeta) *core.Secret

func (*Invocation) SecretForGCSBackend

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

func (*Invocation) SecretForLocalBackend

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

func (*Invocation) SecretForMinioBackend

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

func (*Invocation) SecretForMinioServer

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

func (*Invocation) SecretForS3Backend

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

func (*Invocation) SecretForSwiftBackend

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

func (*Invocation) ServiceAccount

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

func (*Invocation) ServiceForMinioServer

func (i *Invocation) ServiceForMinioServer() core.Service

type PgStatArchiver

type PgStatArchiver struct {
	ArchivedCount int
}

Jump to

Keyboard shortcuts

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