Documentation ¶
Overview ¶
Package k8s is a generated GoMock package.
Package k8s implements the Kubernetes Controller interface to monitor and retrieve information regarding Kubernetes resources such as Namespaces, Services, Pods, Endpoints, and ServiceAccounts.
Index ¶
- Constants
- func DialerToPod(conf *rest.Config, clientSet kubernetes.Interface, podName string, ...) (httpstream.Dialer, error)
- func IsHeadlessService(svc corev1.Service) bool
- func WatchAndUpdateLogLevel(msgBroker *messaging.Broker, stop <-chan struct{})
- func WatchAndUpdateProxyBootstrapSecret(kubeClient kubernetes.Interface, msgBroker *messaging.Broker, ...)
- type Client
- func (c *Client) AddMeshRootCertificateEventHandler(handler cache.ResourceEventHandler) error
- func (c *Client) GetEndpoints(name, namespace string) (*corev1.Endpoints, error)
- func (c *Client) GetExtensionService(svc policyv1alpha1.ExtensionServiceRef) *configv1alpha2.ExtensionService
- func (c *Client) GetHTTPRouteGroup(namespacedName string) *smiSpecs.HTTPRouteGroup
- func (c *Client) GetMeshConfig() configv1alpha2.MeshConfig
- func (c *Client) GetMeshRootCertificate(mrcName string) *configv1alpha2.MeshRootCertificate
- func (c *Client) GetNamespace(ns string) *corev1.Namespace
- func (c *Client) GetOSMNamespace() string
- func (c *Client) GetSecret(name, namespace string) *models.Secret
- func (c *Client) GetService(name, namespace string) *corev1.Service
- func (c *Client) GetTCPRoute(namespacedName string) *smiSpecs.TCPRoute
- func (c *Client) GetUpstreamTrafficSetting(namespace *types.NamespacedName) *policyv1alpha1.UpstreamTrafficSetting
- func (c *Client) IsMonitoredNamespace(namespace string) bool
- func (c *Client) ListEgressPolicies() []*policyv1alpha1.Egress
- func (c *Client) ListHTTPTrafficSpecs() []*smiSpecs.HTTPRouteGroup
- func (c *Client) ListIngressBackendPolicies() []*policyv1alpha1.IngressBackend
- func (c *Client) ListMeshRootCertificates() ([]*configv1alpha2.MeshRootCertificate, error)
- func (c *Client) ListNamespaces() ([]*corev1.Namespace, error)
- func (c *Client) ListPods() []*corev1.Pod
- func (c *Client) ListRetryPolicies() []*policyv1alpha1.Retry
- func (c *Client) ListSecrets() []*models.Secret
- func (c *Client) ListServiceAccounts() []*corev1.ServiceAccount
- func (c *Client) ListServiceExports() []*mcs.ServiceExport
- func (c *Client) ListServiceImports() []*mcs.ServiceImport
- func (c *Client) ListServices() []*corev1.Service
- func (c *Client) ListTCPTrafficSpecs() []*smiSpecs.TCPRoute
- func (c *Client) ListTelemetryPolicies() []*policyv1alpha1.Telemetry
- func (c *Client) ListTrafficSplits() []*smiSplit.TrafficSplit
- func (c *Client) ListTrafficTargets() []*smiAccess.TrafficTarget
- func (c *Client) ListUpstreamTrafficSettings() []*policyv1alpha1.UpstreamTrafficSetting
- func (c *Client) UpdateIngressBackendStatus(obj *policyv1alpha1.IngressBackend) (*policyv1alpha1.IngressBackend, error)
- func (c *Client) UpdateMeshRootCertificate(obj *configv1alpha2.MeshRootCertificate) (*configv1alpha2.MeshRootCertificate, error)
- func (c *Client) UpdateMeshRootCertificateStatus(obj *configv1alpha2.MeshRootCertificate) (*configv1alpha2.MeshRootCertificate, error)
- func (c *Client) UpdateSecret(ctx context.Context, secret *models.Secret) error
- func (c *Client) UpdateUpstreamTrafficSettingStatus(obj *policyv1alpha1.UpstreamTrafficSetting) (*policyv1alpha1.UpstreamTrafficSetting, error)
- type ClientOption
- func WithConfigClient(configClient configClientset.Interface) ClientOption
- func WithKubeClient(kubeClient kubernetes.Interface, meshName string) ClientOption
- func WithMCSClient(client mcsClient.Interface) ClientOption
- func WithPolicyClient(policyClient policyClientset.Interface) ClientOption
- func WithSMIClients(smiTrafficSplitClient smiTrafficSplitClient.Interface, ...) ClientOption
- type Controller
- type EventType
- type MockController
- func (m *MockController) AddMeshRootCertificateEventHandler(arg0 cache.ResourceEventHandler) error
- func (m *MockController) EXPECT() *MockControllerMockRecorder
- func (m *MockController) GetEndpoints(arg0, arg1 string) (*v1.Endpoints, error)
- func (m *MockController) GetExtensionService(arg0 v1alpha1.ExtensionServiceRef) *v1alpha2.ExtensionService
- func (m *MockController) GetHTTPRouteGroup(arg0 string) *v1alpha4.HTTPRouteGroup
- func (m *MockController) GetMeshConfig() v1alpha2.MeshConfig
- func (m *MockController) GetMeshRootCertificate(arg0 string) *v1alpha2.MeshRootCertificate
- func (m *MockController) GetNamespace(arg0 string) *v1.Namespace
- func (m *MockController) GetOSMNamespace() string
- func (m *MockController) GetSecret(arg0, arg1 string) *models.Secret
- func (m *MockController) GetService(arg0, arg1 string) *v1.Service
- func (m *MockController) GetTCPRoute(arg0 string) *v1alpha4.TCPRoute
- func (m *MockController) GetUpstreamTrafficSetting(arg0 *types.NamespacedName) *v1alpha1.UpstreamTrafficSetting
- func (m *MockController) IsMonitoredNamespace(arg0 string) bool
- func (m *MockController) ListEgressPolicies() []*v1alpha1.Egress
- func (m *MockController) ListHTTPTrafficSpecs() []*v1alpha4.HTTPRouteGroup
- func (m *MockController) ListIngressBackendPolicies() []*v1alpha1.IngressBackend
- func (m *MockController) ListMeshRootCertificates() ([]*v1alpha2.MeshRootCertificate, error)
- func (m *MockController) ListNamespaces() ([]*v1.Namespace, error)
- func (m *MockController) ListPods() []*v1.Pod
- func (m *MockController) ListRetryPolicies() []*v1alpha1.Retry
- func (m *MockController) ListSecrets() []*models.Secret
- func (m *MockController) ListServiceAccounts() []*v1.ServiceAccount
- func (m *MockController) ListServiceExports() []*v1alpha10.ServiceExport
- func (m *MockController) ListServiceImports() []*v1alpha10.ServiceImport
- func (m *MockController) ListServices() []*v1.Service
- func (m *MockController) ListTCPTrafficSpecs() []*v1alpha4.TCPRoute
- func (m *MockController) ListTelemetryPolicies() []*v1alpha1.Telemetry
- func (m *MockController) ListTrafficSplits() []*v1alpha20.TrafficSplit
- func (m *MockController) ListTrafficTargets() []*v1alpha3.TrafficTarget
- func (m *MockController) ListUpstreamTrafficSettings() []*v1alpha1.UpstreamTrafficSetting
- func (m *MockController) UpdateIngressBackendStatus(arg0 *v1alpha1.IngressBackend) (*v1alpha1.IngressBackend, error)
- func (m *MockController) UpdateMeshRootCertificate(arg0 *v1alpha2.MeshRootCertificate) (*v1alpha2.MeshRootCertificate, error)
- func (m *MockController) UpdateMeshRootCertificateStatus(arg0 *v1alpha2.MeshRootCertificate) (*v1alpha2.MeshRootCertificate, error)
- func (m *MockController) UpdateSecret(arg0 context.Context, arg1 *models.Secret) error
- func (m *MockController) UpdateUpstreamTrafficSettingStatus(arg0 *v1alpha1.UpstreamTrafficSetting) (*v1alpha1.UpstreamTrafficSetting, error)
- type MockControllerMockRecorder
- func (mr *MockControllerMockRecorder) AddMeshRootCertificateEventHandler(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetEndpoints(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetExtensionService(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetHTTPRouteGroup(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetMeshConfig() *gomock.Call
- func (mr *MockControllerMockRecorder) GetMeshRootCertificate(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetNamespace(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetOSMNamespace() *gomock.Call
- func (mr *MockControllerMockRecorder) GetSecret(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetService(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetTCPRoute(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetUpstreamTrafficSetting(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) IsMonitoredNamespace(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) ListEgressPolicies() *gomock.Call
- func (mr *MockControllerMockRecorder) ListHTTPTrafficSpecs() *gomock.Call
- func (mr *MockControllerMockRecorder) ListIngressBackendPolicies() *gomock.Call
- func (mr *MockControllerMockRecorder) ListMeshRootCertificates() *gomock.Call
- func (mr *MockControllerMockRecorder) ListNamespaces() *gomock.Call
- func (mr *MockControllerMockRecorder) ListPods() *gomock.Call
- func (mr *MockControllerMockRecorder) ListRetryPolicies() *gomock.Call
- func (mr *MockControllerMockRecorder) ListSecrets() *gomock.Call
- func (mr *MockControllerMockRecorder) ListServiceAccounts() *gomock.Call
- func (mr *MockControllerMockRecorder) ListServiceExports() *gomock.Call
- func (mr *MockControllerMockRecorder) ListServiceImports() *gomock.Call
- func (mr *MockControllerMockRecorder) ListServices() *gomock.Call
- func (mr *MockControllerMockRecorder) ListTCPTrafficSpecs() *gomock.Call
- func (mr *MockControllerMockRecorder) ListTelemetryPolicies() *gomock.Call
- func (mr *MockControllerMockRecorder) ListTrafficSplits() *gomock.Call
- func (mr *MockControllerMockRecorder) ListTrafficTargets() *gomock.Call
- func (mr *MockControllerMockRecorder) ListUpstreamTrafficSettings() *gomock.Call
- func (mr *MockControllerMockRecorder) UpdateIngressBackendStatus(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) UpdateMeshRootCertificate(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) UpdateMeshRootCertificateStatus(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) UpdateSecret(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) UpdateUpstreamTrafficSettingStatus(arg0 interface{}) *gomock.Call
- type PassthroughInterface
- type PortForwarder
Constants ¶
const ( // DefaultKubeEventResyncInterval is the default resync interval for k8s events // This is set to 0 because we do not need resyncs from k8s client, and have our // own Ticker to turn on periodic resyncs. DefaultKubeEventResyncInterval = 0 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func DialerToPod ¶
func DialerToPod(conf *rest.Config, clientSet kubernetes.Interface, podName string, namespace string) (httpstream.Dialer, error)
DialerToPod constructs a new httpstream.Dialer to connect to a pod for use with a PortForwarder
func IsHeadlessService ¶
IsHeadlessService determines whether or not a corev1.Service is a headless service
func WatchAndUpdateLogLevel ¶
WatchAndUpdateLogLevel watches for log level changes and updates the global log level
func WatchAndUpdateProxyBootstrapSecret ¶
func WatchAndUpdateProxyBootstrapSecret(kubeClient kubernetes.Interface, msgBroker *messaging.Broker, stop <-chan struct{})
WatchAndUpdateProxyBootstrapSecret watches for new pods being added to the mesh and updates their corresponding proxy bootstrap config Secret's OwnerReferences to point to the associated pod.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the type used to represent the k8s client for the native k8s resources
func NewClient ¶
func NewClient(osmNamespace, meshConfigName string, broker *messaging.Broker, opts ...ClientOption) (*Client, error)
NewClient returns a new kubernetes.Controller which means to provide access to locally-cached k8s resources
func (*Client) AddMeshRootCertificateEventHandler ¶
func (c *Client) AddMeshRootCertificateEventHandler(handler cache.ResourceEventHandler) error
AddMeshRootCertificateEventHandler adds an event handler specific to mesh root certificates. Returns an error if it fails to add the event handler.
func (*Client) GetEndpoints ¶
GetEndpoints returns the endpoint for a given service, otherwise returns nil if not found or error if the API errored out.
func (*Client) GetExtensionService ¶
func (c *Client) GetExtensionService(svc policyv1alpha1.ExtensionServiceRef) *configv1alpha2.ExtensionService
GetExtensionService returns the extension service for the given service ref
func (*Client) GetHTTPRouteGroup ¶
func (c *Client) GetHTTPRouteGroup(namespacedName string) *smiSpecs.HTTPRouteGroup
GetHTTPRouteGroup returns an SMI HTTPRouteGroup resource given its name of the form <namespace>/<name>
func (*Client) GetMeshConfig ¶
func (c *Client) GetMeshConfig() configv1alpha2.MeshConfig
GetMeshConfig returns the current MeshConfig
func (*Client) GetMeshRootCertificate ¶
func (c *Client) GetMeshRootCertificate(mrcName string) *configv1alpha2.MeshRootCertificate
GetMeshRootCertificate returns a MeshRootCertificate resource with namespaced name
func (*Client) GetNamespace ¶
GetNamespace returns a Namespace resource if found, nil otherwise.
func (*Client) GetOSMNamespace ¶
GetOSMNamespace returns the namespace in which the OSM controller pod resides.
func (*Client) GetService ¶
GetService retrieves the Kubernetes Services resource for the given MeshService
func (*Client) GetTCPRoute ¶
GetTCPRoute returns an SMI TCPRoute resource given its name of the form <namespace>/<name>
func (*Client) GetUpstreamTrafficSetting ¶
func (c *Client) GetUpstreamTrafficSetting(namespace *types.NamespacedName) *policyv1alpha1.UpstreamTrafficSetting
GetUpstreamTrafficSetting returns the UpstreamTrafficSetting resources with namespaced name
func (*Client) IsMonitoredNamespace ¶
IsMonitoredNamespace returns a boolean indicating if the namespace is among the list of monitored namespaces
func (*Client) ListEgressPolicies ¶
func (c *Client) ListEgressPolicies() []*policyv1alpha1.Egress
ListEgressPolicies lists the all Egress policies
func (*Client) ListHTTPTrafficSpecs ¶
func (c *Client) ListHTTPTrafficSpecs() []*smiSpecs.HTTPRouteGroup
ListHTTPTrafficSpecs lists SMI HTTPRouteGroup resources
func (*Client) ListIngressBackendPolicies ¶
func (c *Client) ListIngressBackendPolicies() []*policyv1alpha1.IngressBackend
ListIngressBackendPolicies lists the all IngressBackend policies
func (*Client) ListMeshRootCertificates ¶
func (c *Client) ListMeshRootCertificates() ([]*configv1alpha2.MeshRootCertificate, error)
ListMeshRootCertificates returns the MRCs stored in the informerCollection's store
func (*Client) ListNamespaces ¶
ListNamespaces returns all namespaces that the mesh is monitoring.
func (*Client) ListPods ¶
ListPods returns a list of pods part of the mesh Kubecontroller does not currently segment pod notifications, hence it receives notifications for all k8s Pods.
func (*Client) ListRetryPolicies ¶
func (c *Client) ListRetryPolicies() []*policyv1alpha1.Retry
ListRetryPolicies returns the retry policies for the given source identity based on service accounts.
func (*Client) ListSecrets ¶
ListSecrets returns a list of secrets
func (*Client) ListServiceAccounts ¶
func (c *Client) ListServiceAccounts() []*corev1.ServiceAccount
ListServiceAccounts returns a list of service accounts that are part of monitored namespaces
func (*Client) ListServiceExports ¶
func (c *Client) ListServiceExports() []*mcs.ServiceExport
ListServiceExports returns all ServiceExport resources
func (*Client) ListServiceImports ¶
func (c *Client) ListServiceImports() []*mcs.ServiceImport
ListServiceImports returns all ServiceImport resources
func (*Client) ListServices ¶
ListServices returns a list of services that are part of monitored namespaces
func (*Client) ListTCPTrafficSpecs ¶
ListTCPTrafficSpecs lists SMI TCPRoute resources
func (*Client) ListTelemetryPolicies ¶
func (c *Client) ListTelemetryPolicies() []*policyv1alpha1.Telemetry
ListTelemetryPolicies returns all the telemetry policies.
func (*Client) ListTrafficSplits ¶
func (c *Client) ListTrafficSplits() []*smiSplit.TrafficSplit
ListTrafficSplits implements mesh.MeshSpec by returning the list of traffic splits.
func (*Client) ListTrafficTargets ¶
func (c *Client) ListTrafficTargets() []*smiAccess.TrafficTarget
ListTrafficTargets returns the list of traffic targets.
func (*Client) ListUpstreamTrafficSettings ¶
func (c *Client) ListUpstreamTrafficSettings() []*policyv1alpha1.UpstreamTrafficSetting
ListUpstreamTrafficSettings returns the all UpstreamTrafficSetting resources
func (*Client) UpdateIngressBackendStatus ¶
func (c *Client) UpdateIngressBackendStatus(obj *policyv1alpha1.IngressBackend) (*policyv1alpha1.IngressBackend, error)
UpdateIngressBackendStatus updates the status for the provided IngressBackend.
func (*Client) UpdateMeshRootCertificate ¶
func (c *Client) UpdateMeshRootCertificate(obj *configv1alpha2.MeshRootCertificate) (*configv1alpha2.MeshRootCertificate, error)
UpdateMeshRootCertificate updates a MeshRootCertificate.
func (*Client) UpdateMeshRootCertificateStatus ¶
func (c *Client) UpdateMeshRootCertificateStatus(obj *configv1alpha2.MeshRootCertificate) (*configv1alpha2.MeshRootCertificate, error)
UpdateMeshRootCertificateStatus updates the status of a MeshRootCertificate.
func (*Client) UpdateSecret ¶
UpdateSecret updates the given secret
func (*Client) UpdateUpstreamTrafficSettingStatus ¶
func (c *Client) UpdateUpstreamTrafficSettingStatus(obj *policyv1alpha1.UpstreamTrafficSetting) (*policyv1alpha1.UpstreamTrafficSetting, error)
UpdateUpstreamTrafficSettingStatus updates the status for the provided UpstreamTrafficSetting.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a function that modifies an informer collection
func WithConfigClient ¶
func WithConfigClient(configClient configClientset.Interface) ClientOption
WithConfigClient sets the config client for the Client
func WithKubeClient ¶
func WithKubeClient(kubeClient kubernetes.Interface, meshName string) ClientOption
WithKubeClient sets the kubeClient for the Client
func WithMCSClient ¶
func WithMCSClient(client mcsClient.Interface) ClientOption
WithMCSClient sets the MCS clients for the Client
func WithPolicyClient ¶
func WithPolicyClient(policyClient policyClientset.Interface) ClientOption
WithPolicyClient sets the policy client for the Client
func WithSMIClients ¶
func WithSMIClients(smiTrafficSplitClient smiTrafficSplitClient.Interface, smiTrafficSpecClient smiTrafficSpecClient.Interface, smiAccessClient smiTrafficAccessClient.Interface) ClientOption
WithSMIClients sets the SMI clients for the Client
type Controller ¶
type Controller interface { PassthroughInterface // GetSecret returns the secret for a given namespace and secret name GetSecret(string, string) *models.Secret // ListSecrets returns a list of secrets ListSecrets() []*models.Secret // UpdateSecret updates the given secret UpdateSecret(context.Context, *models.Secret) error // ListServices returns a list of all (monitored-namespace filtered) services in the mesh ListServices() []*corev1.Service // ListServiceAccounts returns a list of all (monitored-namespace filtered) service accounts in the mesh ListServiceAccounts() []*corev1.ServiceAccount // GetService returns a corev1 Service representation if the MeshService exists in cache, otherwise nil GetService(name, namespace string) *corev1.Service // GetExtensionService returns the extension service for the given service ref GetExtensionService(svc policyv1alpha1.ExtensionServiceRef) *configv1alpha2.ExtensionService // ListNamespaces returns the namespaces monitored by the mesh ListNamespaces() ([]*corev1.Namespace, error) // GetNamespace returns k8s namespace present in cache GetNamespace(string) *corev1.Namespace // ListPods returns a list of pods part of the mesh ListPods() []*corev1.Pod // GetEndpoints returns the endpoints for a given service, if found GetEndpoints(name, namespace string) (*corev1.Endpoints, error) // ListTelemetryPolices returns all the telemetry policies. ListTelemetryPolicies() []*policyv1alpha1.Telemetry }
Controller is the controller interface for K8s services
type EventType ¶
type EventType string
EventType is the type of event we have received from Kubernetes
type MockController ¶
type MockController struct {
// contains filtered or unexported fields
}
MockController is a mock of Controller interface.
func NewMockController ¶
func NewMockController(ctrl *gomock.Controller) *MockController
NewMockController creates a new mock instance.
func (*MockController) AddMeshRootCertificateEventHandler ¶
func (m *MockController) AddMeshRootCertificateEventHandler(arg0 cache.ResourceEventHandler) error
AddMeshRootCertificateEventHandler mocks base method.
func (*MockController) EXPECT ¶
func (m *MockController) EXPECT() *MockControllerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockController) GetEndpoints ¶
func (m *MockController) GetEndpoints(arg0, arg1 string) (*v1.Endpoints, error)
GetEndpoints mocks base method.
func (*MockController) GetExtensionService ¶
func (m *MockController) GetExtensionService(arg0 v1alpha1.ExtensionServiceRef) *v1alpha2.ExtensionService
GetExtensionService mocks base method.
func (*MockController) GetHTTPRouteGroup ¶
func (m *MockController) GetHTTPRouteGroup(arg0 string) *v1alpha4.HTTPRouteGroup
GetHTTPRouteGroup mocks base method.
func (*MockController) GetMeshConfig ¶
func (m *MockController) GetMeshConfig() v1alpha2.MeshConfig
GetMeshConfig mocks base method.
func (*MockController) GetMeshRootCertificate ¶
func (m *MockController) GetMeshRootCertificate(arg0 string) *v1alpha2.MeshRootCertificate
GetMeshRootCertificate mocks base method.
func (*MockController) GetNamespace ¶
func (m *MockController) GetNamespace(arg0 string) *v1.Namespace
GetNamespace mocks base method.
func (*MockController) GetOSMNamespace ¶
func (m *MockController) GetOSMNamespace() string
GetOSMNamespace mocks base method.
func (*MockController) GetSecret ¶
func (m *MockController) GetSecret(arg0, arg1 string) *models.Secret
GetSecret mocks base method.
func (*MockController) GetService ¶
func (m *MockController) GetService(arg0, arg1 string) *v1.Service
GetService mocks base method.
func (*MockController) GetTCPRoute ¶
func (m *MockController) GetTCPRoute(arg0 string) *v1alpha4.TCPRoute
GetTCPRoute mocks base method.
func (*MockController) GetUpstreamTrafficSetting ¶
func (m *MockController) GetUpstreamTrafficSetting(arg0 *types.NamespacedName) *v1alpha1.UpstreamTrafficSetting
GetUpstreamTrafficSetting mocks base method.
func (*MockController) IsMonitoredNamespace ¶
func (m *MockController) IsMonitoredNamespace(arg0 string) bool
IsMonitoredNamespace mocks base method.
func (*MockController) ListEgressPolicies ¶
func (m *MockController) ListEgressPolicies() []*v1alpha1.Egress
ListEgressPolicies mocks base method.
func (*MockController) ListHTTPTrafficSpecs ¶
func (m *MockController) ListHTTPTrafficSpecs() []*v1alpha4.HTTPRouteGroup
ListHTTPTrafficSpecs mocks base method.
func (*MockController) ListIngressBackendPolicies ¶
func (m *MockController) ListIngressBackendPolicies() []*v1alpha1.IngressBackend
ListIngressBackendPolicies mocks base method.
func (*MockController) ListMeshRootCertificates ¶
func (m *MockController) ListMeshRootCertificates() ([]*v1alpha2.MeshRootCertificate, error)
ListMeshRootCertificates mocks base method.
func (*MockController) ListNamespaces ¶
func (m *MockController) ListNamespaces() ([]*v1.Namespace, error)
ListNamespaces mocks base method.
func (*MockController) ListPods ¶
func (m *MockController) ListPods() []*v1.Pod
ListPods mocks base method.
func (*MockController) ListRetryPolicies ¶
func (m *MockController) ListRetryPolicies() []*v1alpha1.Retry
ListRetryPolicies mocks base method.
func (*MockController) ListSecrets ¶
func (m *MockController) ListSecrets() []*models.Secret
ListSecrets mocks base method.
func (*MockController) ListServiceAccounts ¶
func (m *MockController) ListServiceAccounts() []*v1.ServiceAccount
ListServiceAccounts mocks base method.
func (*MockController) ListServiceExports ¶
func (m *MockController) ListServiceExports() []*v1alpha10.ServiceExport
ListServiceExports mocks base method.
func (*MockController) ListServiceImports ¶
func (m *MockController) ListServiceImports() []*v1alpha10.ServiceImport
ListServiceImports mocks base method.
func (*MockController) ListServices ¶
func (m *MockController) ListServices() []*v1.Service
ListServices mocks base method.
func (*MockController) ListTCPTrafficSpecs ¶
func (m *MockController) ListTCPTrafficSpecs() []*v1alpha4.TCPRoute
ListTCPTrafficSpecs mocks base method.
func (*MockController) ListTelemetryPolicies ¶
func (m *MockController) ListTelemetryPolicies() []*v1alpha1.Telemetry
ListTelemetryPolicies mocks base method.
func (*MockController) ListTrafficSplits ¶
func (m *MockController) ListTrafficSplits() []*v1alpha20.TrafficSplit
ListTrafficSplits mocks base method.
func (*MockController) ListTrafficTargets ¶
func (m *MockController) ListTrafficTargets() []*v1alpha3.TrafficTarget
ListTrafficTargets mocks base method.
func (*MockController) ListUpstreamTrafficSettings ¶
func (m *MockController) ListUpstreamTrafficSettings() []*v1alpha1.UpstreamTrafficSetting
ListUpstreamTrafficSettings mocks base method.
func (*MockController) UpdateIngressBackendStatus ¶
func (m *MockController) UpdateIngressBackendStatus(arg0 *v1alpha1.IngressBackend) (*v1alpha1.IngressBackend, error)
UpdateIngressBackendStatus mocks base method.
func (*MockController) UpdateMeshRootCertificate ¶
func (m *MockController) UpdateMeshRootCertificate(arg0 *v1alpha2.MeshRootCertificate) (*v1alpha2.MeshRootCertificate, error)
UpdateMeshRootCertificate mocks base method.
func (*MockController) UpdateMeshRootCertificateStatus ¶
func (m *MockController) UpdateMeshRootCertificateStatus(arg0 *v1alpha2.MeshRootCertificate) (*v1alpha2.MeshRootCertificate, error)
UpdateMeshRootCertificateStatus mocks base method.
func (*MockController) UpdateSecret ¶
UpdateSecret mocks base method.
func (*MockController) UpdateUpstreamTrafficSettingStatus ¶
func (m *MockController) UpdateUpstreamTrafficSettingStatus(arg0 *v1alpha1.UpstreamTrafficSetting) (*v1alpha1.UpstreamTrafficSetting, error)
UpdateUpstreamTrafficSettingStatus mocks base method.
type MockControllerMockRecorder ¶
type MockControllerMockRecorder struct {
// contains filtered or unexported fields
}
MockControllerMockRecorder is the mock recorder for MockController.
func (*MockControllerMockRecorder) AddMeshRootCertificateEventHandler ¶
func (mr *MockControllerMockRecorder) AddMeshRootCertificateEventHandler(arg0 interface{}) *gomock.Call
AddMeshRootCertificateEventHandler indicates an expected call of AddMeshRootCertificateEventHandler.
func (*MockControllerMockRecorder) GetEndpoints ¶
func (mr *MockControllerMockRecorder) GetEndpoints(arg0, arg1 interface{}) *gomock.Call
GetEndpoints indicates an expected call of GetEndpoints.
func (*MockControllerMockRecorder) GetExtensionService ¶
func (mr *MockControllerMockRecorder) GetExtensionService(arg0 interface{}) *gomock.Call
GetExtensionService indicates an expected call of GetExtensionService.
func (*MockControllerMockRecorder) GetHTTPRouteGroup ¶
func (mr *MockControllerMockRecorder) GetHTTPRouteGroup(arg0 interface{}) *gomock.Call
GetHTTPRouteGroup indicates an expected call of GetHTTPRouteGroup.
func (*MockControllerMockRecorder) GetMeshConfig ¶
func (mr *MockControllerMockRecorder) GetMeshConfig() *gomock.Call
GetMeshConfig indicates an expected call of GetMeshConfig.
func (*MockControllerMockRecorder) GetMeshRootCertificate ¶
func (mr *MockControllerMockRecorder) GetMeshRootCertificate(arg0 interface{}) *gomock.Call
GetMeshRootCertificate indicates an expected call of GetMeshRootCertificate.
func (*MockControllerMockRecorder) GetNamespace ¶
func (mr *MockControllerMockRecorder) GetNamespace(arg0 interface{}) *gomock.Call
GetNamespace indicates an expected call of GetNamespace.
func (*MockControllerMockRecorder) GetOSMNamespace ¶
func (mr *MockControllerMockRecorder) GetOSMNamespace() *gomock.Call
GetOSMNamespace indicates an expected call of GetOSMNamespace.
func (*MockControllerMockRecorder) GetSecret ¶
func (mr *MockControllerMockRecorder) GetSecret(arg0, arg1 interface{}) *gomock.Call
GetSecret indicates an expected call of GetSecret.
func (*MockControllerMockRecorder) GetService ¶
func (mr *MockControllerMockRecorder) GetService(arg0, arg1 interface{}) *gomock.Call
GetService indicates an expected call of GetService.
func (*MockControllerMockRecorder) GetTCPRoute ¶
func (mr *MockControllerMockRecorder) GetTCPRoute(arg0 interface{}) *gomock.Call
GetTCPRoute indicates an expected call of GetTCPRoute.
func (*MockControllerMockRecorder) GetUpstreamTrafficSetting ¶
func (mr *MockControllerMockRecorder) GetUpstreamTrafficSetting(arg0 interface{}) *gomock.Call
GetUpstreamTrafficSetting indicates an expected call of GetUpstreamTrafficSetting.
func (*MockControllerMockRecorder) IsMonitoredNamespace ¶
func (mr *MockControllerMockRecorder) IsMonitoredNamespace(arg0 interface{}) *gomock.Call
IsMonitoredNamespace indicates an expected call of IsMonitoredNamespace.
func (*MockControllerMockRecorder) ListEgressPolicies ¶
func (mr *MockControllerMockRecorder) ListEgressPolicies() *gomock.Call
ListEgressPolicies indicates an expected call of ListEgressPolicies.
func (*MockControllerMockRecorder) ListHTTPTrafficSpecs ¶
func (mr *MockControllerMockRecorder) ListHTTPTrafficSpecs() *gomock.Call
ListHTTPTrafficSpecs indicates an expected call of ListHTTPTrafficSpecs.
func (*MockControllerMockRecorder) ListIngressBackendPolicies ¶
func (mr *MockControllerMockRecorder) ListIngressBackendPolicies() *gomock.Call
ListIngressBackendPolicies indicates an expected call of ListIngressBackendPolicies.
func (*MockControllerMockRecorder) ListMeshRootCertificates ¶
func (mr *MockControllerMockRecorder) ListMeshRootCertificates() *gomock.Call
ListMeshRootCertificates indicates an expected call of ListMeshRootCertificates.
func (*MockControllerMockRecorder) ListNamespaces ¶
func (mr *MockControllerMockRecorder) ListNamespaces() *gomock.Call
ListNamespaces indicates an expected call of ListNamespaces.
func (*MockControllerMockRecorder) ListPods ¶
func (mr *MockControllerMockRecorder) ListPods() *gomock.Call
ListPods indicates an expected call of ListPods.
func (*MockControllerMockRecorder) ListRetryPolicies ¶
func (mr *MockControllerMockRecorder) ListRetryPolicies() *gomock.Call
ListRetryPolicies indicates an expected call of ListRetryPolicies.
func (*MockControllerMockRecorder) ListSecrets ¶
func (mr *MockControllerMockRecorder) ListSecrets() *gomock.Call
ListSecrets indicates an expected call of ListSecrets.
func (*MockControllerMockRecorder) ListServiceAccounts ¶
func (mr *MockControllerMockRecorder) ListServiceAccounts() *gomock.Call
ListServiceAccounts indicates an expected call of ListServiceAccounts.
func (*MockControllerMockRecorder) ListServiceExports ¶
func (mr *MockControllerMockRecorder) ListServiceExports() *gomock.Call
ListServiceExports indicates an expected call of ListServiceExports.
func (*MockControllerMockRecorder) ListServiceImports ¶
func (mr *MockControllerMockRecorder) ListServiceImports() *gomock.Call
ListServiceImports indicates an expected call of ListServiceImports.
func (*MockControllerMockRecorder) ListServices ¶
func (mr *MockControllerMockRecorder) ListServices() *gomock.Call
ListServices indicates an expected call of ListServices.
func (*MockControllerMockRecorder) ListTCPTrafficSpecs ¶
func (mr *MockControllerMockRecorder) ListTCPTrafficSpecs() *gomock.Call
ListTCPTrafficSpecs indicates an expected call of ListTCPTrafficSpecs.
func (*MockControllerMockRecorder) ListTelemetryPolicies ¶
func (mr *MockControllerMockRecorder) ListTelemetryPolicies() *gomock.Call
ListTelemetryPolicies indicates an expected call of ListTelemetryPolicies.
func (*MockControllerMockRecorder) ListTrafficSplits ¶
func (mr *MockControllerMockRecorder) ListTrafficSplits() *gomock.Call
ListTrafficSplits indicates an expected call of ListTrafficSplits.
func (*MockControllerMockRecorder) ListTrafficTargets ¶
func (mr *MockControllerMockRecorder) ListTrafficTargets() *gomock.Call
ListTrafficTargets indicates an expected call of ListTrafficTargets.
func (*MockControllerMockRecorder) ListUpstreamTrafficSettings ¶
func (mr *MockControllerMockRecorder) ListUpstreamTrafficSettings() *gomock.Call
ListUpstreamTrafficSettings indicates an expected call of ListUpstreamTrafficSettings.
func (*MockControllerMockRecorder) UpdateIngressBackendStatus ¶
func (mr *MockControllerMockRecorder) UpdateIngressBackendStatus(arg0 interface{}) *gomock.Call
UpdateIngressBackendStatus indicates an expected call of UpdateIngressBackendStatus.
func (*MockControllerMockRecorder) UpdateMeshRootCertificate ¶
func (mr *MockControllerMockRecorder) UpdateMeshRootCertificate(arg0 interface{}) *gomock.Call
UpdateMeshRootCertificate indicates an expected call of UpdateMeshRootCertificate.
func (*MockControllerMockRecorder) UpdateMeshRootCertificateStatus ¶
func (mr *MockControllerMockRecorder) UpdateMeshRootCertificateStatus(arg0 interface{}) *gomock.Call
UpdateMeshRootCertificateStatus indicates an expected call of UpdateMeshRootCertificateStatus.
func (*MockControllerMockRecorder) UpdateSecret ¶
func (mr *MockControllerMockRecorder) UpdateSecret(arg0, arg1 interface{}) *gomock.Call
UpdateSecret indicates an expected call of UpdateSecret.
func (*MockControllerMockRecorder) UpdateUpstreamTrafficSettingStatus ¶
func (mr *MockControllerMockRecorder) UpdateUpstreamTrafficSettingStatus(arg0 interface{}) *gomock.Call
UpdateUpstreamTrafficSettingStatus indicates an expected call of UpdateUpstreamTrafficSettingStatus.
type PassthroughInterface ¶
type PassthroughInterface interface { // IsMonitoredNamespace returns whether a namespace with the given name is being monitored // by the mesh IsMonitoredNamespace(string) bool GetMeshConfig() configv1alpha2.MeshConfig GetMeshRootCertificate(mrcName string) *configv1alpha2.MeshRootCertificate AddMeshRootCertificateEventHandler(handler cache.ResourceEventHandler) error ListMeshRootCertificates() ([]*configv1alpha2.MeshRootCertificate, error) UpdateMeshRootCertificate(obj *configv1alpha2.MeshRootCertificate) (*configv1alpha2.MeshRootCertificate, error) UpdateMeshRootCertificateStatus(obj *configv1alpha2.MeshRootCertificate) (*configv1alpha2.MeshRootCertificate, error) GetOSMNamespace() string UpdateIngressBackendStatus(obj *policyv1alpha1.IngressBackend) (*policyv1alpha1.IngressBackend, error) UpdateUpstreamTrafficSettingStatus(obj *policyv1alpha1.UpstreamTrafficSetting) (*policyv1alpha1.UpstreamTrafficSetting, error) // ListEgressPolicies lists the all Egress policies ListEgressPolicies() []*policyv1alpha1.Egress // ListIngressBackends lists the all IngressBackend policies ListIngressBackendPolicies() []*policyv1alpha1.IngressBackend // ListRetryPolicies returns the all retry policies ListRetryPolicies() []*policyv1alpha1.Retry // ListUpstreamTrafficSettings returns all UpstreamTrafficSetting resources ListUpstreamTrafficSettings() []*policyv1alpha1.UpstreamTrafficSetting // GetUpstreamTrafficSetting returns the UpstreamTrafficSetting resources with namespaced name GetUpstreamTrafficSetting(*types.NamespacedName) *policyv1alpha1.UpstreamTrafficSetting // ListTrafficSplits lists SMI TrafficSplit resources ListTrafficSplits() []*split.TrafficSplit // 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() []*access.TrafficTarget // ListServiceImports returns all the ServiceImport resources ListServiceImports() []*mcs.ServiceImport // ListServiceExports returns all the ServiceExport resources ListServiceExports() []*mcs.ServiceExport }
PassthroughInterface is the interface for methods that are implemented by the k8s.Client, but are not considered specific to kubernetes, and thus do not need further abstraction, and can be used throughout the code base without fear of coupling to k8s. That is to say that another implementation that may exist for a bare metal control plane would be expected to implement these methods as well. In this way, for instance, a *policyv1alpha1.IngressBackend is not considered an object uniquely specific to kubernetes, but an object tied to OSM. A good rule of thumb is that any CRUD operations (get,delete,create,update,etc) on CRD's we define belong here, since we control the definition it is reasonable to assume a non-k8s implementation would be obligated to implement as well.
type PortForwarder ¶
type PortForwarder struct {
// contains filtered or unexported fields
}
PortForwarder is a type that implements port forwarding to a pod
func NewPortForwarder ¶
func NewPortForwarder(dialer httpstream.Dialer, portSpec string) (*PortForwarder, error)
NewPortForwarder creates a new port forwarder to a pod
func (*PortForwarder) Done ¶
func (pf *PortForwarder) Done() <-chan struct{}
Done returns a channel that is closed after Stop has been called.
func (*PortForwarder) Start ¶
func (pf *PortForwarder) Start(readyFunc func(pf *PortForwarder) error) error
Start starts the port forwarding and calls the readyFunc callback function when port forwarding is ready
func (*PortForwarder) Stop ¶
func (pf *PortForwarder) Stop()
Stop stops the port forwarding if not stopped already
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package events implements the eventing framework to receive and relay kubernetes events, and a framework to publish events to the Kubernetes API server.
|
Package events implements the eventing framework to receive and relay kubernetes events, and a framework to publish events to the Kubernetes API server. |