converter

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

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

	// DeleteArgsFromKey returns name and namespace of the object to pass to Delete
	// for the given key as generated by GetKey.
	DeleteArgsFromKey(key string) (string, 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

func NewServiceAccountConverter

func NewServiceAccountConverter() Converter

NewServiceaccountConverter Constructor to convert ServiceAccount to Profile

type WorkloadEndpointData

type WorkloadEndpointData struct {
	PodName   string
	Namespace 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