smi

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package smi is a generated GoMock package.

Package smi implements the Service Mesh Interface (SMI) kubernetes client to observe and retrieve information regarding SMI traffic resources.

Index

Constants

View Source
const (
	// ServiceAccountKind is the kind specified for the destination and sources in an SMI TrafficTarget policy
	ServiceAccountKind = "ServiceAccount"

	// TCPRouteKind is the kind specified for the TCP route rules in an SMI Traffictarget policy
	TCPRouteKind = "TCPRoute"

	// HTTPRouteGroupKind is the kind specified for the HTTP route rules in an SMI Traffictarget policy
	HTTPRouteGroupKind = "HTTPRouteGroup"
)

Variables

This section is empty.

Functions

func FilterTrafficSplit added in v1.2.0

func FilterTrafficSplit(trafficSplit *smiSplit.TrafficSplit, options ...TrafficSplitListOption) *smiSplit.TrafficSplit

FilterTrafficSplit applies the given TrafficSplitListOption filter on the given TrafficSplit object

func FilterTrafficTarget added in v1.2.0

func FilterTrafficTarget(trafficTarget *smiAccess.TrafficTarget, options ...TrafficTargetListOption) *smiAccess.TrafficTarget

FilterTrafficTarget applies the given TrafficTargetListOption filter on the given TrafficTarget object

func GetSmiClientVersionHTTPHandler added in v0.9.0

func GetSmiClientVersionHTTPHandler() http.Handler

GetSmiClientVersionHTTPHandler returns an http handler that returns supported smi version information

Types

type Client

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

Client is a type that implements the smi.MeshSpec interface related to Kubernetes SMI resources

func NewSMIClient added in v1.2.0

func NewSMIClient(informerCollection *informers.InformerCollection, osmNamespace string, kubeController k8s.Controller, msgBroker *messaging.Broker) *Client

NewSMIClient implements mesh.MeshSpec and creates the Kubernetes client, which retrieves SMI specific CRDs.

func (*Client) GetHTTPRouteGroup added in v1.2.0

func (c *Client) GetHTTPRouteGroup(namespacedName string) *smiSpecs.HTTPRouteGroup

GetHTTPRouteGroup returns an SMI HTTPRouteGroup resource given its name of the form <namespace>/<name>

func (*Client) GetTCPRoute added in v0.7.0

func (c *Client) GetTCPRoute(namespacedName string) *smiSpecs.TCPRoute

GetTCPRoute returns an SMI TCPRoute resource given its name of the form <namespace>/<name>

func (*Client) ListHTTPTrafficSpecs

func (c *Client) ListHTTPTrafficSpecs() []*smiSpecs.HTTPRouteGroup

ListHTTPTrafficSpecs lists SMI HTTPRouteGroup resources

func (*Client) ListServiceAccounts

func (c *Client) ListServiceAccounts() []identity.K8sServiceAccount

ListServiceAccounts lists ServiceAccounts specified in SMI TrafficTarget resources

func (*Client) ListTCPTrafficSpecs added in v0.4.0

func (c *Client) ListTCPTrafficSpecs() []*smiSpecs.TCPRoute

ListTCPTrafficSpecs lists SMI TCPRoute resources

func (*Client) ListTrafficSplits

func (c *Client) ListTrafficSplits(options ...TrafficSplitListOption) []*smiSplit.TrafficSplit

ListTrafficSplits implements mesh.MeshSpec by returning the list of traffic splits.

func (*Client) ListTrafficTargets

func (c *Client) ListTrafficTargets(options ...TrafficTargetListOption) []*smiAccess.TrafficTarget

ListTrafficTargets implements mesh.Topology by returning the list of traffic targets.

type HealthChecker added in v0.9.0

type HealthChecker struct {
	DiscoveryClient discovery.ServerResourcesInterface
}

HealthChecker has SMI clientset interface to access SMI CRDS

func (HealthChecker) GetID added in v0.9.0

func (c HealthChecker) GetID() string

GetID returns the ID of the probe

func (HealthChecker) Liveness added in v0.9.0

func (c HealthChecker) Liveness() bool

Liveness is the Kubernetes liveness probe handler.

func (HealthChecker) Readiness added in v0.9.0

func (c HealthChecker) Readiness() bool

Readiness is the Kubernetes readiness probe handler.

type MeshSpec

type MeshSpec interface {
	// ListTrafficSplits lists SMI TrafficSplit resources
	ListTrafficSplits(...TrafficSplitListOption) []*split.TrafficSplit

	// ListServiceAccounts lists ServiceAccount resources specified in SMI TrafficTarget resources
	ListServiceAccounts() []identity.K8sServiceAccount

	// ListHTTPTrafficSpecs lists SMI HTTPRouteGroup resources
	ListHTTPTrafficSpecs() []*spec.HTTPRouteGroup

	// GetHTTPRouteGroup returns an SMI HTTPRouteGroup resource given its name of the form <namespace>/<name>
	GetHTTPRouteGroup(string) *spec.HTTPRouteGroup

	// ListTCPTrafficSpecs lists SMI TCPRoute resources
	ListTCPTrafficSpecs() []*spec.TCPRoute

	// GetTCPRoute returns an SMI TCPRoute resource given its name of the form <namespace>/<name>
	GetTCPRoute(string) *spec.TCPRoute

	// ListTrafficTargets lists SMI TrafficTarget resources. An optional filter can be applied to filter the
	// returned list
	ListTrafficTargets(...TrafficTargetListOption) []*access.TrafficTarget
}

MeshSpec is an interface declaring functions, which provide the specs for a service mesh declared with SMI.

type MockMeshSpec added in v0.6.0

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

MockMeshSpec is a mock of MeshSpec interface.

func NewMockMeshSpec added in v0.6.0

func NewMockMeshSpec(ctrl *gomock.Controller) *MockMeshSpec

NewMockMeshSpec creates a new mock instance.

func (*MockMeshSpec) EXPECT added in v0.6.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMeshSpec) GetHTTPRouteGroup added in v0.9.0

func (m *MockMeshSpec) GetHTTPRouteGroup(arg0 string) *v1alpha4.HTTPRouteGroup

GetHTTPRouteGroup mocks base method.

func (*MockMeshSpec) GetTCPRoute added in v0.7.0

func (m *MockMeshSpec) GetTCPRoute(arg0 string) *v1alpha4.TCPRoute

GetTCPRoute mocks base method.

func (*MockMeshSpec) ListHTTPTrafficSpecs added in v0.6.0

func (m *MockMeshSpec) ListHTTPTrafficSpecs() []*v1alpha4.HTTPRouteGroup

ListHTTPTrafficSpecs mocks base method.

func (*MockMeshSpec) ListServiceAccounts added in v0.6.0

func (m *MockMeshSpec) ListServiceAccounts() []identity.K8sServiceAccount

ListServiceAccounts mocks base method.

func (*MockMeshSpec) ListTCPTrafficSpecs added in v0.6.0

func (m *MockMeshSpec) ListTCPTrafficSpecs() []*v1alpha4.TCPRoute

ListTCPTrafficSpecs mocks base method.

func (*MockMeshSpec) ListTrafficSplits added in v0.6.0

func (m *MockMeshSpec) ListTrafficSplits(arg0 ...TrafficSplitListOption) []*v1alpha2.TrafficSplit

ListTrafficSplits mocks base method.

func (*MockMeshSpec) ListTrafficTargets added in v0.6.0

func (m *MockMeshSpec) ListTrafficTargets(arg0 ...TrafficTargetListOption) []*v1alpha3.TrafficTarget

ListTrafficTargets mocks base method.

type MockMeshSpecMockRecorder added in v0.6.0

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

MockMeshSpecMockRecorder is the mock recorder for MockMeshSpec.

func (*MockMeshSpecMockRecorder) GetHTTPRouteGroup added in v0.9.0

func (mr *MockMeshSpecMockRecorder) GetHTTPRouteGroup(arg0 interface{}) *gomock.Call

GetHTTPRouteGroup indicates an expected call of GetHTTPRouteGroup.

func (*MockMeshSpecMockRecorder) GetTCPRoute added in v0.7.0

func (mr *MockMeshSpecMockRecorder) GetTCPRoute(arg0 interface{}) *gomock.Call

GetTCPRoute indicates an expected call of GetTCPRoute.

func (*MockMeshSpecMockRecorder) ListHTTPTrafficSpecs added in v0.6.0

func (mr *MockMeshSpecMockRecorder) ListHTTPTrafficSpecs() *gomock.Call

ListHTTPTrafficSpecs indicates an expected call of ListHTTPTrafficSpecs.

func (*MockMeshSpecMockRecorder) ListServiceAccounts added in v0.6.0

func (mr *MockMeshSpecMockRecorder) ListServiceAccounts() *gomock.Call

ListServiceAccounts indicates an expected call of ListServiceAccounts.

func (*MockMeshSpecMockRecorder) ListTCPTrafficSpecs added in v0.6.0

func (mr *MockMeshSpecMockRecorder) ListTCPTrafficSpecs() *gomock.Call

ListTCPTrafficSpecs indicates an expected call of ListTCPTrafficSpecs.

func (*MockMeshSpecMockRecorder) ListTrafficSplits added in v0.6.0

func (mr *MockMeshSpecMockRecorder) ListTrafficSplits(arg0 ...interface{}) *gomock.Call

ListTrafficSplits indicates an expected call of ListTrafficSplits.

func (*MockMeshSpecMockRecorder) ListTrafficTargets added in v0.6.0

func (mr *MockMeshSpecMockRecorder) ListTrafficTargets(arg0 ...interface{}) *gomock.Call

ListTrafficTargets indicates an expected call of ListTrafficTargets.

type TrafficSplitListOpt added in v0.11.0

type TrafficSplitListOpt struct {
	ApexService    service.MeshService
	BackendService service.MeshService
	KubeController k8s.Controller
}

TrafficSplitListOpt specifies the options used to filter TrafficSplit objects as a part of its lister

type TrafficSplitListOption added in v0.11.0

type TrafficSplitListOption func(o *TrafficSplitListOpt)

TrafficSplitListOption is a function type that implements filters on the TrafficSplit lister

func WithKubeController added in v1.2.0

func WithKubeController(c k8s.Controller) TrafficSplitListOption

WithKubeController adds a KubeController to the TrafficSplit lister

func WithTrafficSplitApexService added in v0.11.0

func WithTrafficSplitApexService(s service.MeshService) TrafficSplitListOption

WithTrafficSplitApexService applies a filter based on the apex service to the TrafficSplit lister

func WithTrafficSplitBackendService added in v0.11.0

func WithTrafficSplitBackendService(s service.MeshService) TrafficSplitListOption

WithTrafficSplitBackendService applies a filter based on the backend service to the TrafficSplit lister

type TrafficTargetListOpt added in v0.11.0

type TrafficTargetListOpt struct {
	Destination identity.K8sServiceAccount
}

TrafficTargetListOpt specifies the options used to filter TrafficTarget objects as a part of its lister

type TrafficTargetListOption added in v0.11.0

type TrafficTargetListOption func(o *TrafficTargetListOpt)

TrafficTargetListOption is a function type that implements filters on TrafficTarget lister

func WithTrafficTargetDestination added in v0.11.0

func WithTrafficTargetDestination(d identity.K8sServiceAccount) TrafficTargetListOption

WithTrafficTargetDestination applies a filter based on the destination service account to the TrafficTarget lister

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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