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: 35 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.

Index

Constants

View Source
const (
	GET            = "get"
	LIST           = "list"
	PATCH          = "patch"
	CREATE         = "create"
	UPDATE         = "update"
	USE            = "use"
	POLICY         = "policy"
	Role           = "Role"
	ServiceAccount = "ServiceAccount"
)

Variables

View Source
var (
	DockerRegistry = "kubedbci"
	DBCatalogName  = "4.0-v2"
	Cluster        = true
)

Functions

func AssertSlotsEqual

func AssertSlotsEqual(slots, wanted []rd.ClusterSlot) error

func Sync

func Sync(addrs [][]string, redis *api.Redis) ([][]RedisNode, [][]*rd.Client)

Types

type ClusterScenario

type ClusterScenario struct {
	Nodes   [][]RedisNode
	Clients [][]*rd.Client
}

func (*ClusterScenario) Addrs

func (s *ClusterScenario) Addrs() []string

func (*ClusterScenario) ClusterClient

func (s *ClusterScenario) ClusterClient(opt *rd.ClusterOptions) *rd.ClusterClient

func (*ClusterScenario) ClusterNodes

func (s *ClusterScenario) ClusterNodes(slotStart, slotEnd int) []rd.ClusterNode

type Framework

type Framework struct {
	StorageClass string
	// contains filtered or unexported fields
}

func New

func New(
	restConfig *rest.Config,
	kubeClient kubernetes.Interface,
	extClient cs.Interface,
	kaClient ka.Interface,
	appCatalogClient appcat_cs.AppcatalogV1alpha1Interface,
	storageClass string,
) *Framework

func (*Framework) CheckAppBindingSpec

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

func (*Framework) CleanRedis

func (f *Framework) CleanRedis()

func (*Framework) CreateNamespace

func (f *Framework) CreateNamespace() error

func (*Framework) CreateRedis

func (f *Framework) CreateRedis(obj *api.Redis) 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) CreateServiceAccount

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

func (*Framework) DeleteNamespace

func (f *Framework) DeleteNamespace() error

func (*Framework) DeleteRedis

func (f *Framework) DeleteRedis(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) EventuallyGetItem

func (f *Framework) EventuallyGetItem(meta metav1.ObjectMeta, key string) GomegaAsyncAssertion

func (*Framework) EventuallyPVCCount

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

func (*Framework) EventuallyRedis

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

func (*Framework) EventuallyRedisConfig

func (f *Framework) EventuallyRedisConfig(meta metav1.ObjectMeta, config string) GomegaAsyncAssertion

func (*Framework) EventuallyRedisPhase

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

func (*Framework) EventuallyRedisRunning

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

func (*Framework) EventuallySetItem

func (f *Framework) EventuallySetItem(meta metav1.ObjectMeta, key, value string) 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) GetDatabasePod

func (f *Framework) GetDatabasePod(meta metav1.ObjectMeta) (*core.Pod, error)

func (*Framework) GetPodsIPWithTunnel

func (f *Framework) GetPodsIPWithTunnel(redis *api.Redis) ([][]string, [][]*portforward.Tunnel, error)

func (*Framework) GetRedis

func (f *Framework) GetRedis(meta metav1.ObjectMeta) (*api.Redis, error)

func (*Framework) GetRedisClient

func (f *Framework) GetRedisClient(meta metav1.ObjectMeta) (*redis.Client, error)

func (*Framework) Invoke

func (f *Framework) Invoke() *Invocation

func (*Framework) Namespace

func (f *Framework) Namespace() string

func (*Framework) PatchRedis

func (f *Framework) PatchRedis(meta metav1.ObjectMeta, transform func(*api.Redis) *api.Redis) (*api.Redis, error)

func (*Framework) PrintDebugHelpers

func (f *Framework) PrintDebugHelpers()

func (*Framework) RedisClusterOptions

func (f *Framework) RedisClusterOptions() *rd.ClusterOptions

func (*Framework) WaitUntilRedisClusterConfigured

func (f *Framework) WaitUntilRedisClusterConfigured(redis *api.Redis, port string) error

func (*Framework) WaitUntilStatefulSetReady

func (f *Framework) WaitUntilStatefulSetReady(redis *api.Redis) error

type Invocation

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

func (*Invocation) CreateConfigMap

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

func (*Invocation) DeleteConfigMap

func (fi *Invocation) DeleteConfigMap(meta metav1.ObjectMeta) error

func (*Invocation) ExtClient

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

func (*Invocation) GetCustomConfig

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

func (*Invocation) GetPod

func (fi *Invocation) GetPod(meta metav1.ObjectMeta) (*core.Pod, error)

func (*Invocation) Redis

func (fi *Invocation) Redis() *api.Redis

func (*Invocation) RedisCluster

func (fi *Invocation) RedisCluster() *api.Redis

func (*Invocation) RestConfig

func (fi *Invocation) RestConfig() *rest.Config

func (*Invocation) RoleBinding

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

func (*Invocation) RoleForElasticsearch

func (fi *Invocation) RoleForElasticsearch(meta metav1.ObjectMeta) *rbac.Role

func (*Invocation) RoleForSnapshot

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

func (*Invocation) ServiceAccount

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

type RedisNode

type RedisNode struct {
	SlotStart []int
	SlotEnd   []int
	SlotsCnt  int

	ID       string
	IP       string
	Port     string
	Role     string
	Down     bool
	MasterID string

	Master *RedisNode
	Slaves []*RedisNode
}

Jump to

Keyboard shortcuts

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