Documentation ¶
Overview ¶
Package fake implements various fake KubeClients for use in testing
Index ¶
- type FailingKubeClient
- func (f *FailingKubeClient) Build(r io.Reader) (kube.Result, error)
- func (f *FailingKubeClient) BuildUnstructured(r io.Reader) (kube.Result, error)
- func (f *FailingKubeClient) Create(r io.Reader) error
- func (f *FailingKubeClient) Delete(r io.Reader) error
- func (f *FailingKubeClient) Get(r io.Reader) (string, error)
- func (f *FailingKubeClient) Update(r, modifiedReader io.Reader, not, needed bool) error
- func (f *FailingKubeClient) Wait(r io.Reader, d time.Duration) error
- func (f *FailingKubeClient) WaitAndGetCompletedPodPhase(s string, d time.Duration) (v1.PodPhase, error)
- func (f *FailingKubeClient) WatchUntilReady(r io.Reader, d time.Duration) error
- type PrintingKubeClient
- func (p *PrintingKubeClient) Build(_ io.Reader) (kube.Result, error)
- func (p *PrintingKubeClient) BuildUnstructured(_ io.Reader) (kube.Result, error)
- func (p *PrintingKubeClient) Create(r io.Reader) error
- func (p *PrintingKubeClient) Delete(r io.Reader) error
- func (p *PrintingKubeClient) Get(r io.Reader) (string, error)
- func (p *PrintingKubeClient) Update(_, modifiedReader io.Reader, _, _ bool) error
- func (p *PrintingKubeClient) Wait(r io.Reader, _ time.Duration) error
- func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(_ string, _ time.Duration) (v1.PodPhase, error)
- func (p *PrintingKubeClient) WatchUntilReady(r io.Reader, _ time.Duration) error
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) BuildUnstructured ¶
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) 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 ¶
WatchUntilReady returns the configured error if set or prints
type PrintingKubeClient ¶
PrintingKubeClient implements KubeClient, but simply prints the reader to the given output.
func (*PrintingKubeClient) BuildUnstructured ¶
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) WaitAndGetCompletedPodPhase ¶
func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(_ string, _ time.Duration) (v1.PodPhase, error)
WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase.
func (*PrintingKubeClient) WatchUntilReady ¶
WatchUntilReady implements KubeClient WatchUntilReady.