testing

package
Version: v0.0.0-...-b0aca5f Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: BSD-3-Clause Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortNodes

func SortNodes(nodes []*apiv1.Node)

func UpdatePodContainerStatus

func UpdatePodContainerStatus(pod *apiv1.Pod, running bool)

Types

type ClientWrapper

type ClientWrapper struct {
	*fake.Clientset
	ApiExtensionsClientset *fakeapiextensions.Clientset
	TsuruClientset         *faketsuru.Clientset
	MetricsClientset       *fakemetrics.Clientset
	VPAClientset           *fakevpa.Clientset
	BackendClientset       *fakeBackendConfig.Clientset
	ClusterInterface
}

func (*ClientWrapper) ApiextensionsV1

func (*ClientWrapper) CoreV1

func (c *ClientWrapper) CoreV1() v1core.CoreV1Interface

func (*ClientWrapper) TsuruV1

type ClusterInterface

type ClusterInterface interface {
	CoreV1() v1core.CoreV1Interface
	RestConfig() *rest.Config
	AppNamespace(context.Context, appTypes.App) (string, error)
	PoolNamespace(string) string
	Namespace() string
	GetCluster() *provTypes.Cluster
}

type KubeMock

type KubeMock struct {
	Stream      map[string]StreamResult
	LogHook     func(w io.Writer, r *http.Request)
	DefaultHook func(w http.ResponseWriter, r *http.Request)

	HandleSize    bool
	IgnorePool    bool
	IgnoreAppName bool
	// contains filtered or unexported fields
}

func (*KubeMock) AppReaction

func (s *KubeMock) AppReaction(a provision.App, c *check.C) ktesting.ReactionFunc

func (*KubeMock) CRDReaction

func (s *KubeMock) CRDReaction(c *check.C) ktesting.ReactionFunc

func (*KubeMock) CreateDeployReadyServer

func (s *KubeMock) CreateDeployReadyServer(c *check.C) (*httptest.Server, *sync.WaitGroup)

func (*KubeMock) DefaultReactions

func (s *KubeMock) DefaultReactions(c *check.C) (*provisiontest.FakeApp, func(), func())

func (*KubeMock) DeploymentReactions

func (s *KubeMock) DeploymentReactions(c *check.C) func()

func (*KubeMock) ListPodsHandler

func (s *KubeMock) ListPodsHandler(c *check.C, funcs ...func(r *http.Request)) func(w http.ResponseWriter, r *http.Request)

func (*KubeMock) MockfakeNodes

func (s *KubeMock) MockfakeNodes(c *check.C, urls ...string)

func (*KubeMock) NoAppReactions

func (s *KubeMock) NoAppReactions(c *check.C) (func(), func())

func (*KubeMock) NoNodeReactions

func (s *KubeMock) NoNodeReactions(c *check.C) (*provisiontest.FakeApp, func(), func())

func (*KubeMock) ServiceWithPortReaction

func (s *KubeMock) ServiceWithPortReaction(c *check.C, ports []apiv1.ServicePort) ktesting.ReactionFunc

func (*KubeMock) WaitNodeUpdate

func (s *KubeMock) WaitNodeUpdate(c *check.C, fn func())

func (*KubeMock) WaitNodeUpdateCount

func (s *KubeMock) WaitNodeUpdateCount(c *check.C, countOnly bool, fn func())

type StreamResult

type StreamResult struct {
	Stdin  string
	Resize string
	Urls   []url.URL
}

Source Files

Jump to

Keyboard shortcuts

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