npm

package
v1.4.51 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 19 Imported by: 1

Documentation

Overview

Copyright 2018 Microsoft. All rights reserved. MIT License

Copyright 2018 Microsoft. All rights reserved. MIT License

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheEncoder

func CacheEncoder(nodeName string) json.Marshaler

CacheEncoder is used only for unit tests to test encoding and decoding Cache.

func GetAIMetadata

func GetAIMetadata() string

GetAIMetadata returns ai metadata number

Types

type NetworkPolicyManager

type NetworkPolicyManager struct {
	Dataplane dataplane.GenericDataplane

	// Informers are the Kubernetes Informer
	// https://pkg.go.dev/k8s.io/client-go/informers
	models.Informers

	// Legacy controllers for handling Kubernetes resource watcher events
	// To be deprecated
	models.K8SControllersV1

	// Controllers for handling Kubernetes resource watcher events
	models.K8SControllersV2

	// Azure-specific variables
	models.AzureConfig
	// contains filtered or unexported fields
}

NetworkPolicyManager contains informers for pod, namespace and networkpolicy.

func NewNetworkPolicyManager

func NewNetworkPolicyManager(config npmconfig.Config,
	informerFactory informers.SharedInformerFactory,
	dp dataplane.GenericDataplane,
	exec utilexec.Interface,
	npmVersion string,
	k8sServerVersion *version.Info) *NetworkPolicyManager

NewNetworkPolicyManager creates a NetworkPolicyManager

func (*NetworkPolicyManager) GetAppVersion

func (npMgr *NetworkPolicyManager) GetAppVersion() string

GetAppVersion returns network policy manager app version

func (*NetworkPolicyManager) MarshalJSON

func (npMgr *NetworkPolicyManager) MarshalJSON() ([]byte, error)

Dear Time Traveler: This is the server end of the debug dragons den. Several of these properties of the npMgr struct have overridden methods which override the MarshalJson, just as this one is doing for npMgr. For example, npMgr.NamespaceCacheV2 does not marshal the whole struct, but rather the NsMap of type map[string]*Namespace. When unmarshaling, expect this type, and pay very close attention. Many hours have been wasted here when unmarshaling mismatched types.

func (*NetworkPolicyManager) Start

func (npMgr *NetworkPolicyManager) Start(config npmconfig.Config, stopCh <-chan struct{}) error

Start starts shared informers and waits for the shared informer cache to sync.

Directories

Path Synopsis
http
api
Package ipsm focus on ip set operation Copyright 2018 Microsoft.
Package ipsm focus on ip set operation Copyright 2018 Microsoft.
pkg
controlplane/translation
Package translation converts NetworkPolicy object to policies.NPMNetworkPolicy object which contains necessary information to program dataplanes.
Package translation converts NetworkPolicy object to policies.NPMNetworkPolicy object which contains necessary information to program dataplanes.
dataplane/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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