configurator

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the k8s client struct for the OSM Config.

func (*Client) GetAnnouncementsChannel

func (c *Client) GetAnnouncementsChannel() <-chan interface{}

GetAnnouncementsChannel returns a channel, which is used to announce when changes have been made to the OSM ConfigMap.

func (*Client) GetConfigMap

func (c *Client) GetConfigMap() ([]byte, error)

GetConfigMap returns the ConfigMap in pretty JSON.

func (*Client) GetOSMNamespace

func (c *Client) GetOSMNamespace() string

GetOSMNamespace returns the namespace in which the OSM controller pod resides.

func (*Client) IsEgressEnabled

func (c *Client) IsEgressEnabled() bool

IsEgressEnabled determines whether egress is globally enabled in the mesh or not.

func (*Client) IsPermissiveTrafficPolicyMode

func (c *Client) IsPermissiveTrafficPolicyMode() bool

IsPermissiveTrafficPolicyMode tells us whether the OSM Control Plane is in permissive mode, where all existing traffic is allowed to flow as it is, or it is in SMI Spec mode, in which only traffic between source/destinations referenced in SMI policies is allowed.

func (*Client) IsPrometheusScrapingEnabled

func (c *Client) IsPrometheusScrapingEnabled() bool

IsPrometheusScrapingEnabled determines whether Prometheus is enabled for scraping metrics

func (*Client) IsZipkinTracingEnabled

func (c *Client) IsZipkinTracingEnabled() bool

IsZipkinTracingEnabled determines whether Zipkin tracing is enabled

type Configurator

type Configurator interface {
	// GetOSMNamespace returns the namespace in which OSM controller pod resides
	GetOSMNamespace() string

	// GetConfigMap returns the ConfigMap in pretty JSON (human readable)
	GetConfigMap() ([]byte, error)

	// IsPermissiveTrafficPolicyMode determines whether we are in "allow-all" mode or SMI policy (block by default) mode
	IsPermissiveTrafficPolicyMode() bool

	// IsEgressEnabled determines whether egress is globally enabled in the mesh or not
	IsEgressEnabled() bool

	// IsPrometheusScrapingEnabled determines whether Prometheus is enabled for scraping metrics
	IsPrometheusScrapingEnabled() bool

	// IsZipkinTracingEnabled determines whether Zipkin tracing is enabled
	IsZipkinTracingEnabled() bool

	// GetAnnouncementsChannel returns a channel, which is used to announce when changes have been made to the OSM ConfigMap
	GetAnnouncementsChannel() <-chan interface{}
}

Configurator is the controller interface for K8s namespaces

func NewConfigurator

func NewConfigurator(kubeClient kubernetes.Interface, stop <-chan struct{}, osmNamespace, osmConfigMapName string) Configurator

NewConfigurator implements configurator.Configurator and creates the Kubernetes client to manage namespaces.

func NewFakeConfigurator

func NewFakeConfigurator() Configurator

NewFakeConfigurator create a new fake Configurator

type FakeConfigurator

type FakeConfigurator struct {
	OSMNamespace                string
	PermissiveTrafficPolicyMode bool
	Egress                      bool
	PrometheusScraping          bool
	ZipkinTracing               bool
}

FakeConfigurator is the fake type for the Configurator client

func (FakeConfigurator) GetAnnouncementsChannel

func (f FakeConfigurator) GetAnnouncementsChannel() <-chan interface{}

GetAnnouncementsChannel returns a fake announcement channel

func (FakeConfigurator) GetConfigMap

func (f FakeConfigurator) GetConfigMap() ([]byte, error)

GetConfigMap returns the data stored in the configMap

func (FakeConfigurator) GetOSMNamespace

func (f FakeConfigurator) GetOSMNamespace() string

GetOSMNamespace returns the namespace in which the OSM controller pod resides.

func (FakeConfigurator) IsEgressEnabled

func (f FakeConfigurator) IsEgressEnabled() bool

IsEgressEnabled determines whether egress is globally enabled in the mesh or not.

func (FakeConfigurator) IsPermissiveTrafficPolicyMode

func (f FakeConfigurator) IsPermissiveTrafficPolicyMode() bool

IsPermissiveTrafficPolicyMode tells us whether the OSM Control Plane is in permissive mode

func (FakeConfigurator) IsPrometheusScrapingEnabled

func (f FakeConfigurator) IsPrometheusScrapingEnabled() bool

IsPrometheusScrapingEnabled determines whether Prometheus is enabled for scraping metrics

func (FakeConfigurator) IsZipkinTracingEnabled

func (f FakeConfigurator) IsZipkinTracingEnabled() bool

IsZipkinTracingEnabled determines whether Zipkin tracing is enabled

Jump to

Keyboard shortcuts

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