fake

package
v3.0.0-alpha.2+incompa... Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fake implements various fake KubeClients for use in testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailingKubeClient

type FailingKubeClient struct {
	PrintingKubeClient
	CreateError                      error
	WaitError                        error
	GetError                         error
	DeleteError                      error
	WatchUntilReadyError             error
	UpdateError                      error
	BuildError                       error
	BuildUnstructuredError           error
	WaitAndGetCompletedPodPhaseError error
}

FailingKubeClient implements KubeClient for testing purposes. It also has additional errors you can set to fail different functions, otherwise it delegates all its calls to `PrintingKubeClient`

func (*FailingKubeClient) Build

func (f *FailingKubeClient) Build(r io.Reader) (kube.Result, error)

Build returns the configured error if set or prints

func (*FailingKubeClient) BuildUnstructured

func (f *FailingKubeClient) BuildUnstructured(r io.Reader) (kube.Result, error)

BuildUnstructured returns the configured error if set or prints

func (*FailingKubeClient) Create

func (f *FailingKubeClient) Create(r io.Reader) error

Create returns the configured error if set or prints

func (*FailingKubeClient) Delete

func (f *FailingKubeClient) Delete(r io.Reader) error

Delete returns the configured error if set or prints

func (*FailingKubeClient) Get

func (f *FailingKubeClient) Get(r io.Reader) (string, error)

Create returns the configured error if set or prints

func (*FailingKubeClient) Update

func (f *FailingKubeClient) Update(r, modifiedReader io.Reader, not, needed bool) error

Update returns the configured error if set or prints

func (*FailingKubeClient) Wait

func (f *FailingKubeClient) Wait(r io.Reader, d time.Duration) error

Wait returns the configured error if set or prints

func (*FailingKubeClient) WaitAndGetCompletedPodPhase

func (f *FailingKubeClient) WaitAndGetCompletedPodPhase(s string, d time.Duration) (v1.PodPhase, error)

WaitAndGetCompletedPodPhase returns the configured error if set or prints

func (*FailingKubeClient) WatchUntilReady

func (f *FailingKubeClient) WatchUntilReady(r io.Reader, d time.Duration) error

WatchUntilReady returns the configured error if set or prints

type PrintingKubeClient

type PrintingKubeClient struct {
	Out io.Writer
}

PrintingKubeClient implements KubeClient, but simply prints the reader to the given output.

func (*PrintingKubeClient) Build

func (p *PrintingKubeClient) Build(_ io.Reader) (kube.Result, error)

Build implements KubeClient Build.

func (*PrintingKubeClient) BuildUnstructured

func (p *PrintingKubeClient) BuildUnstructured(_ io.Reader) (kube.Result, error)

func (*PrintingKubeClient) Create

func (p *PrintingKubeClient) Create(r io.Reader) error

Create prints the values of what would be created with a real KubeClient.

func (*PrintingKubeClient) Delete

func (p *PrintingKubeClient) Delete(r io.Reader) error

Delete implements KubeClient delete.

It only prints out the content to be deleted.

func (*PrintingKubeClient) Get

func (p *PrintingKubeClient) Get(r io.Reader) (string, error)

Get prints the values of what would be created with a real KubeClient.

func (*PrintingKubeClient) Update

func (p *PrintingKubeClient) Update(_, modifiedReader io.Reader, _, _ bool) error

Update implements KubeClient Update.

func (*PrintingKubeClient) Wait

func (*PrintingKubeClient) WaitAndGetCompletedPodPhase

func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(_ string, _ time.Duration) (v1.PodPhase, error)

WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase.

func (*PrintingKubeClient) WatchUntilReady

func (p *PrintingKubeClient) WatchUntilReady(r io.Reader, _ time.Duration) error

WatchUntilReady implements KubeClient WatchUntilReady.

Jump to

Keyboard shortcuts

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