testing

package
v0.0.0-...-9451de5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunReactionsAfter

func RunReactionsAfter(fake *ktesting.Fake, action ktesting.Action) (bool, runtime.Object, error)

RunReactionsAfter is a hack and it MUST be called from inside a reaction function if it modifies the source object and returns false. This code only exists because of the behavior change introduced by DeepCopying objects in https://github.com/kubernetes/kubernetes/pull/60709.

The regression was identified and should be fixed in https://github.com/kubernetes/kubernetes/pull/73601

When the latter PR is merged and we update k8s.io/client-go accordingly this code can be safely removed.

func UpdatePodContainerStatus

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

Types

type ClientWrapper

type ClientWrapper struct {
	*fake.Clientset
	ApiExtensionsClientset *fakeapiextensions.Clientset
	TsuruClientset         *faketsuru.Clientset
	ClusterInterface
}

func (*ClientWrapper) ApiextensionsV1beta1

func (*ClientWrapper) CoreV1

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

func (*ClientWrapper) TsuruV1

type ClusterInterface

type ClusterInterface interface {
	CoreV1() v1core.CoreV1Interface
	RestConfig() *rest.Config
	AppNamespace(provision.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) ServiceWithPortReaction

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

type StreamResult

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

Jump to

Keyboard shortcuts

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