cni

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cni lists the networks a node's CNI conf dir declares.

Index

Constants

View Source
const (
	// ConfDir is where the CNI plugins read their configuration.
	ConfDir = "/etc/cni/net.d"
	// ListScript prints every conf under the dir given as $1, in the shape Parse reads.
	ListScript = `cat "$1"/*.conflist "$1"/*.conf 2>/dev/null || true`
)

Variables

This section is empty.

Functions

func Parse

func Parse(confs string, drivers []string) ([]*enginetypes.Network, error)

Parse turns the confs ListScript printed into networks, narrowed to drivers when any are named.

func Select

func Select(confs string, keep func(Conf) bool) ([]*enginetypes.Network, error)

Select turns the confs ListScript printed into the networks keep accepts.

Types

type Conf

type Conf struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	IPAM    ipam   `json:"ipam"`
	Plugins []Conf `json:"plugins"`
}

Conf is the subset of a CNI network configuration core reports.

func (Conf) Subnets

func (c Conf) Subnets() []string

Subnets lists what the conf and its plugins hand addresses out of.

Jump to

Keyboard shortcuts

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