utils

package
v0.0.0-...-55e8439 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespaceExclude is the default list of namespaces to exclude in network isolation
	DefaultNamespaceExclude = "kube-system"
	// DefaultLabelSelector is the default label selector to use as a namespace watch filter
	DefaultLabelSelector = ""
	// DefaultIgnoreSelector is the default label selector to use to identify namespaces to be ignored
	DefaultIgnoreSelector = ""
	// DefaultIsolateNamespace is the default choice for locking down a namespace
	DefaultIsolateNamespace = false
)

Variables

This section is empty.

Functions

func GetClient

func GetClient() (*unversioned.Client, error)

GetClient retrieves a k8s client based on the current kube config

func GetExtensionsClient

func GetExtensionsClient() (*unversioned.ExtensionsClient, error)

GetExtensionsClient retrieves a k8s extensions client based on current kube config

func SearchStrings

func SearchStrings(set []string, target string) int

SearchStrings searchs a slice of strings for the given string and returns its index or -1

Types

type Config

type Config struct {
	Excludes          []string
	LabelSelector     labels.Selector
	IgnoreSelector    labels.Selector
	IsolateNamespace  bool
	RoutingNamespace  string
	RoutingLabelName  string
	RoutingPolicyName string
}

Config contains the configurable variables used by the congress policy maker and watcher

func ConfigFromEnv

func ConfigFromEnv() (*Config, error)

ConfigFromEnv returns the configuration based on the environment variables

func (*Config) InIgnoreSelector

func (c *Config) InIgnoreSelector(set map[string]string) bool

InIgnoreSelector checks to see if the given labels contain an ignored label.

func (*Config) IsExcluded

func (c *Config) IsExcluded(target string) bool

IsExcluded checks to see if the given target namespace name should be excluded or not

Jump to

Keyboard shortcuts

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