converter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 8 Imported by: 14

Documentation

Index

Constants

View Source
const ProfileNameFormat = "k8s_ns."

ProfileNameFormat Format used by policy controller to name Calico profiles

Variables

This section is empty.

Functions

func MergeWorkloadEndpointData

func MergeWorkloadEndpointData(wep *api.WorkloadEndpoint, upd WorkloadEndpointData)

MergeWorkloadEndpointData applies the given WorkloadEndpointData to the provided WorkloadEndpoint, updating relevant fields with new values.

Types

type Converter

type Converter interface {
	// Converts kubernetes object to calico representation of it.
	Convert(k8sObj interface{}) (interface{}, error)

	// Returns apporpriate key for the object
	GetKey(obj interface{}) string
}

Converter Responsible for conversion of given kubernetes object to equivalent calico object

func NewNamespaceConverter

func NewNamespaceConverter() Converter

NewNamespaceConverter Constructor for namespaceConverter

func NewPodConverter

func NewPodConverter() Converter

NewPodConverter Constructor for podConverter

func NewPolicyConverter

func NewPolicyConverter() Converter

NewPolicyConverter Constructor for policyConverter

type WorkloadEndpointData

type WorkloadEndpointData struct {
	Key    string
	Labels map[string]string
}

WorkloadEndpointData is an internal struct used to store the various bits of information that the policy controller cares about on a workload endpoint.

func BuildWorkloadEndpointData

func BuildWorkloadEndpointData(wep api.WorkloadEndpoint) WorkloadEndpointData

BuildWorkloadEndpointData generates the correct WorkloadEndpointData for the given WorkloadEndpoint, extracting fields that the policy controller is responsible for syncing.

Jump to

Keyboard shortcuts

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