v1alpha1

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 MockKnServingClient added in v0.11.0

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

func NewMockKnServiceClient added in v0.11.0

func NewMockKnServiceClient(t *testing.T, ns ...string) *MockKnServingClient

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

func (*MockKnServingClient) CreateService added in v0.11.0

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

func (*MockKnServingClient) DeleteRevision added in v0.11.0

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

func (*MockKnServingClient) DeleteService added in v0.11.0

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

func (*MockKnServingClient) GetBaseRevision added in v0.11.0

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

Check for the base reviision

func (*MockKnServingClient) GetConfiguration added in v0.11.0

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

GetConfiguration returns a configuration looked up by name

func (*MockKnServingClient) GetRevision added in v0.11.0

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

func (*MockKnServingClient) GetRoute added in v0.11.0

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

func (*MockKnServingClient) GetService added in v0.11.0

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

func (*MockKnServingClient) ListRevisions added in v0.11.0

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

func (*MockKnServingClient) ListRoutes added in v0.11.0

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

func (*MockKnServingClient) ListServices added in v0.11.0

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

func (*MockKnServingClient) Namespace added in v0.11.0

func (c *MockKnServingClient) Namespace() string

Namespace of this client

func (*MockKnServingClient) Recorder added in v0.11.0

func (c *MockKnServingClient) Recorder() *ServingRecorder

Get the record to start for the recorder

func (*MockKnServingClient) UpdateService added in v0.11.0

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

func (*MockKnServingClient) WaitForService added in v0.11.0

func (c *MockKnServingClient) 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 ServingRecorder added in v0.11.0

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

recorder for service

func (*ServingRecorder) CreateService added in v0.11.0

func (sr *ServingRecorder) CreateService(service interface{}, err error)

Create a new service

func (*ServingRecorder) DeleteRevision added in v0.11.0

func (sr *ServingRecorder) DeleteRevision(name interface{}, err error)

Delete a revision

func (*ServingRecorder) DeleteService added in v0.11.0

func (sr *ServingRecorder) DeleteService(name interface{}, err error)

Delete a service by name

func (*ServingRecorder) GetConfiguration added in v0.11.0

func (sr *ServingRecorder) GetConfiguration(name string, config *v1alpha1.Configuration, err error)

GetConfiguration records a call to GetConfiguration with possible return values

func (*ServingRecorder) GetRevision added in v0.11.0

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

Get a revision by name

func (*ServingRecorder) GetRoute added in v0.11.0

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

Get a route by its unique name

func (*ServingRecorder) GetService added in v0.11.0

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

Get Service

func (*ServingRecorder) ListRevisions added in v0.11.0

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

List revisions

func (*ServingRecorder) ListRoutes added in v0.11.0

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

List routes

func (*ServingRecorder) ListServices added in v0.11.0

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

List services

func (*ServingRecorder) UpdateService added in v0.11.0

func (sr *ServingRecorder) UpdateService(service interface{}, err error)

Update the given service

func (*ServingRecorder) Validate added in v0.11.0

func (sr *ServingRecorder) Validate()

Check that every recorded method has been called

func (*ServingRecorder) WaitForService added in v0.11.0

func (sr *ServingRecorder) 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