ipam

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "ipam"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

Types

type AzureConfigPersister

type AzureConfigPersister struct {
	// contains filtered or unexported fields
}

func NewAzureConfigPersister

func NewAzureConfigPersister(config AzureConfigPersisterConfig) (*AzureConfigPersister, error)

func (*AzureConfigPersister) Persist

func (p *AzureConfigPersister) Persist(ctx context.Context, vnet net.IPNet, namespace string, name string) error

type AzureConfigPersisterConfig

type AzureConfigPersisterConfig struct {
	G8sClient versioned.Interface
	Logger    micrologger.Logger
}

type Checker

type Checker interface {
	Check(ctx context.Context, namespace string, name string) (bool, error)
}

Checker determines whether a subnet has to be allocated. This decision is being made based on the status of the Kubernetes runtime object defined by namespace and name.

type ClusterChecker

type ClusterChecker struct {
	// contains filtered or unexported fields
}

func NewClusterChecker

func NewClusterChecker(config ClusterCheckerConfig) (*ClusterChecker, error)

func (*ClusterChecker) Check

func (c *ClusterChecker) Check(ctx context.Context, namespace string, name string) (bool, error)

type ClusterCheckerConfig

type ClusterCheckerConfig struct {
	G8sClient versioned.Interface
	Logger    micrologger.Logger
}

type Collector

type Collector interface {
	Collect(ctx context.Context) ([]net.IPNet, error)
}

Collector implementation must return all networks that are allocated on any given moment. Failing to do that will result in overlapping allocations.

type Config

type Config struct {
	Checker   Checker
	Collector Collector
	Locker    locker.Interface
	Logger    micrologger.Logger
	Persister Persister

	AllocatedSubnetMaskBits int
	NetworkRange            net.IPNet
}

type Persister

type Persister interface {
	Persist(ctx context.Context, subnet net.IPNet, namespace string, name string) error
}

Persister must mutate shared persistent state so that on successful execution persisted networks are visible by Collector implementations.

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Resource, error)

func (*Resource) EnsureCreated

func (r *Resource) EnsureCreated(ctx context.Context, obj interface{}) error

EnsureCreated allocates tenant cluster network segments. It gathers existing subnets from existing system resources like Vnets and Cluster CRs.

func (*Resource) EnsureDeleted

func (r *Resource) EnsureDeleted(ctx context.Context, obj interface{}) error

func (*Resource) Name

func (r *Resource) Name() string

type SubnetCollector

type SubnetCollector struct {
	// contains filtered or unexported fields
}

func NewSubnetCollector

func NewSubnetCollector(config SubnetCollectorConfig) (*SubnetCollector, error)

func (*SubnetCollector) Collect

func (c *SubnetCollector) Collect(ctx context.Context) ([]net.IPNet, error)

type SubnetCollectorConfig

type SubnetCollectorConfig struct {
	CredentialProvider credential.Provider
	K8sClient          k8sclient.Interface
	InstallationName   string
	Logger             micrologger.Logger

	NetworkRange net.IPNet
}

type TestChecker

type TestChecker struct {
	// contains filtered or unexported fields
}

func NewTestChecker

func NewTestChecker(proceed bool) *TestChecker

func (*TestChecker) Check

func (c *TestChecker) Check(ctx context.Context, namespace string, name string) (bool, error)

type TestCollector

type TestCollector struct {
	// contains filtered or unexported fields
}

func NewTestCollector

func NewTestCollector(subnets []net.IPNet) *TestCollector

func (*TestCollector) Collect

func (c *TestCollector) Collect(ctx context.Context) ([]net.IPNet, error)

type TestPersister

type TestPersister struct {
	// contains filtered or unexported fields
}

func NewTestPersister

func NewTestPersister(subnet net.IPNet) *TestPersister

func (*TestPersister) Persist

func (p *TestPersister) Persist(ctx context.Context, subnet net.IPNet, namespace string, name string) error

Jump to

Keyboard shortcuts

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