server

package
v0.0.0-...-76cd193 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Package server is the package that contains server functions.

Index

Constants

View Source
const PolicyNetworkAnnotation = "k8s.v1.cni.cncf.io/policy-for"

PolicyNetworkAnnotation is annotation for multiNetworkPolicy, to specify which networks(i.e. net-attach-def) are the targets of the policy

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// kubeconfig is the path to a KubeConfig file.
	Kubeconfig string
	// contains filtered or unexported fields
}

Options stores option for the command

func NewOptions

func NewOptions() *Options

NewOptions initializes Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags adds command line flags into command

func (*Options) Run

func (o *Options) Run() error

Run invokes server

func (*Options) Stop

func (o *Options) Stop()

Stop halts the command

func (*Options) Validate

func (o *Options) Validate() error

Validate checks several options and fill processed value

type Server

type Server struct {
	Client   clientset.Interface
	Hostname string

	NetworkPolicyClient multiclient.Interface
	NetDefClient        netdefclient.Interface
	Broadcaster         record.EventBroadcaster
	Recorder            record.EventRecorder
	Options             *Options
	ConfigSyncPeriod    time.Duration
	NodeRef             *v1.ObjectReference
	// contains filtered or unexported fields
}

Server structure defines data for server

func NewServer

func NewServer(o *Options) (*Server, error)

NewServer ...

func (*Server) AllSynced

func (s *Server) AllSynced() bool

AllSynced ...

func (*Server) OnNamespaceAdd

func (s *Server) OnNamespaceAdd(ns *v1.Namespace)

OnNamespaceAdd ...

func (*Server) OnNamespaceDelete

func (s *Server) OnNamespaceDelete(ns *v1.Namespace)

OnNamespaceDelete ...

func (*Server) OnNamespaceSynced

func (s *Server) OnNamespaceSynced()

OnNamespaceSynced ...

func (*Server) OnNamespaceUpdate

func (s *Server) OnNamespaceUpdate(oldNamespace, ns *v1.Namespace)

OnNamespaceUpdate ...

func (*Server) OnNetDefAdd

func (s *Server) OnNetDefAdd(net *netdefv1.NetworkAttachmentDefinition)

OnNetDefAdd ...

func (*Server) OnNetDefDelete

func (s *Server) OnNetDefDelete(net *netdefv1.NetworkAttachmentDefinition)

OnNetDefDelete ...

func (*Server) OnNetDefSynced

func (s *Server) OnNetDefSynced()

OnNetDefSynced ...

func (*Server) OnNetDefUpdate

func (s *Server) OnNetDefUpdate(oldNet, net *netdefv1.NetworkAttachmentDefinition)

OnNetDefUpdate ...

func (*Server) OnPodAdd

func (s *Server) OnPodAdd(pod *v1.Pod)

OnPodAdd ...

func (*Server) OnPodDelete

func (s *Server) OnPodDelete(pod *v1.Pod)

OnPodDelete ...

func (*Server) OnPodSynced

func (s *Server) OnPodSynced()

OnPodSynced ...

func (*Server) OnPodUpdate

func (s *Server) OnPodUpdate(oldPod, pod *v1.Pod)

OnPodUpdate ...

func (*Server) OnPolicyAdd

func (s *Server) OnPolicyAdd(policy *multiv1beta1.MultiNetworkPolicy)

OnPolicyAdd ...

func (*Server) OnPolicyDelete

func (s *Server) OnPolicyDelete(policy *multiv1beta1.MultiNetworkPolicy)

OnPolicyDelete ...

func (*Server) OnPolicySynced

func (s *Server) OnPolicySynced()

OnPolicySynced ...

func (*Server) OnPolicyUpdate

func (s *Server) OnPolicyUpdate(oldPolicy, policy *multiv1beta1.MultiNetworkPolicy)

OnPolicyUpdate ...

func (*Server) Run

func (s *Server) Run(_ string, stopCh chan struct{})

Run ...

func (*Server) RunPodConfig

func (s *Server) RunPodConfig()

RunPodConfig ...

func (*Server) Sync

func (s *Server) Sync()

Sync ...

func (*Server) SyncLoop

func (s *Server) SyncLoop()

SyncLoop ...

Jump to

Keyboard shortcuts

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