v1alpha1

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any() func(t *testing.T, a interface{})

any() can be used in recording to not check for the argument

func HasFieldSelector

func HasFieldSelector(keyAndValues ...string) func(t *testing.T, a interface{})

HasFieldSelector returns a comparable which can be used for asserting that list methods are called with the appropriate field selectors

func HasLabelSelector

func HasLabelSelector(keyAndValues ...string) func(t *testing.T, a interface{})

HasLabelSelector returns a comparable which can be used for asserting that list methods are called with the appropriate label selector

func HasSelector

func HasSelector(labelKeysAndValues []string, fieldKeysAndValue []string) func(t *testing.T, a interface{})

HasSelector returns a comparable which can be used for asserting that list methods are called with the appropriate label and field selectors

Types

type KnServingClient

type KnServingClient interface {

	// Namespace in which this client is operating for
	Namespace() string

	// Get a service by its unique name
	GetService(name string) (*v1alpha1.Service, error)

	// List services
	ListServices(opts ...ListConfig) (*v1alpha1.ServiceList, error)

	// Create a new service
	CreateService(service *v1alpha1.Service) error

	// Update the given service
	UpdateService(service *v1alpha1.Service) error

	// Delete a service by name
	DeleteService(name string) error

	// Wait for a service to become ready, but not longer than provided timeout.
	// Return error and how long has been waited
	WaitForService(name string, timeout time.Duration, msgCallback wait.MessageCallback) (error, time.Duration)

	// Get a configuration by name
	GetConfiguration(name string) (*v1alpha1.Configuration, error)

	// Get a revision by name
	GetRevision(name string) (*v1alpha1.Revision, error)

	// Get the "base" revision for a Service; the one that corresponds to the
	// current template.
	GetBaseRevision(service *v1alpha1.Service) (*v1alpha1.Revision, error)

	// List revisions
	ListRevisions(opts ...ListConfig) (*v1alpha1.RevisionList, error)

	// Delete a revision
	DeleteRevision(name string) error

	// Get a route by its unique name
	GetRoute(name string) (*v1alpha1.Route, error)

	// List routes
	ListRoutes(opts ...ListConfig) (*v1alpha1.RouteList, error)
}

Kn interface to serving. All methods are relative to the namespace specified during construction

func NewKnServingClient

func NewKnServingClient(client client_v1alpha1.ServingV1alpha1Interface, namespace string) KnServingClient

Create a new client facade for the provided namespace

type ListConfig

type ListConfig func(config *listConfigCollector)

Config function for builder pattern

func WithName

func WithName(name string) ListConfig

Filter list on the provided name

func WithService

func WithService(service string) ListConfig

Filter on the service name

type ListConfigs

type ListConfigs []ListConfig

type MockKnClient

type MockKnClient struct {
	// contains filtered or unexported fields
}

func NewMockKnClient

func NewMockKnClient(t *testing.T) *MockKnClient

NewMockKnClient returns a new mock instance which you need to record for

func (*MockKnClient) CreateService

func (c *MockKnClient) CreateService(service *v1alpha1.Service) error

func (*MockKnClient) DeleteRevision

func (c *MockKnClient) DeleteRevision(name string) error

func (*MockKnClient) DeleteService

func (c *MockKnClient) DeleteService(name string) error

func (*MockKnClient) GetBaseRevision

func (c *MockKnClient) GetBaseRevision(service *v1alpha1.Service) (*v1alpha1.Revision, error)

func (*MockKnClient) GetConfiguration

func (c *MockKnClient) GetConfiguration(name string) (*v1alpha1.Configuration, error)

GetConfiguration returns a configuration looked up by name

func (*MockKnClient) GetRevision

func (c *MockKnClient) GetRevision(name string) (*v1alpha1.Revision, error)

func (*MockKnClient) GetRoute

func (c *MockKnClient) GetRoute(name string) (*v1alpha1.Route, error)

func (*MockKnClient) GetService

func (c *MockKnClient) GetService(name string) (*v1alpha1.Service, error)

func (*MockKnClient) ListRevisions

func (c *MockKnClient) ListRevisions(opts ...ListConfig) (*v1alpha1.RevisionList, error)

func (*MockKnClient) ListRoutes

func (c *MockKnClient) ListRoutes(opts ...ListConfig) (*v1alpha1.RouteList, error)

func (*MockKnClient) ListServices

func (c *MockKnClient) ListServices(opts ...ListConfig) (*v1alpha1.ServiceList, error)

func (*MockKnClient) Namespace

func (c *MockKnClient) Namespace() string

Namespace of this client

func (*MockKnClient) Recorder

func (c *MockKnClient) Recorder() *Recorder

Get the record to start for the recorder

func (*MockKnClient) UpdateService

func (c *MockKnClient) UpdateService(service *v1alpha1.Service) error

func (*MockKnClient) WaitForService

func (c *MockKnClient) WaitForService(name string, timeout time.Duration, msgCallback wait.MessageCallback) (error, time.Duration)

type NoBaseRevisionError

type NoBaseRevisionError struct {
	// contains filtered or unexported fields
}

func (NoBaseRevisionError) Error

func (e NoBaseRevisionError) Error() string

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

func (*Recorder) CreateService

func (r *Recorder) CreateService(service interface{}, err error)

Create a new service

func (*Recorder) DeleteRevision

func (r *Recorder) DeleteRevision(name interface{}, err error)

Delete a revision

func (*Recorder) DeleteService

func (r *Recorder) DeleteService(name interface{}, err error)

Delete a service by name

func (*Recorder) GetConfiguration

func (r *Recorder) GetConfiguration(name string, config *v1alpha1.Configuration, err error)

GetConfiguration records a call to GetConfiguration with possible return values

func (*Recorder) GetRevision

func (r *Recorder) GetRevision(name interface{}, revision *v1alpha1.Revision, err error)

Get a revision by name

func (*Recorder) GetRoute

func (r *Recorder) GetRoute(name interface{}, route *v1alpha1.Route, err error)

Get a route by its unique name

func (*Recorder) GetService

func (r *Recorder) GetService(name interface{}, service *v1alpha1.Service, err error)

Get Service

func (*Recorder) ListRevisions

func (r *Recorder) ListRevisions(opts interface{}, revisionList *v1alpha1.RevisionList, err error)

List revisions

func (*Recorder) ListRoutes

func (r *Recorder) ListRoutes(opts interface{}, routeList *v1alpha1.RouteList, err error)

List routes

func (*Recorder) ListServices

func (r *Recorder) ListServices(opts interface{}, serviceList *v1alpha1.ServiceList, err error)

List services

func (*Recorder) Namespace

func (r *Recorder) Namespace(namespace string)

func (*Recorder) UpdateService

func (r *Recorder) UpdateService(service interface{}, err error)

Update the given service

func (*Recorder) Validate

func (r *Recorder) Validate()

Check that every recorded method has been called

func (*Recorder) WaitForService

func (r *Recorder) WaitForService(name interface{}, timeout interface{}, callback interface{}, err error, duration time.Duration)

Wait for a service to become ready, but not longer than provided timeout

Jump to

Keyboard shortcuts

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