api

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CNI = "cni"

	EnvPrefix = "AZURE_CNI"

	//CNI Install Flags
	FlagMode              = "mode"
	FlagTarget            = "target"
	FlagIPAM              = "ipam"
	FlagOS                = "os"
	FlagTenancy           = "tenancy"
	FlagExempt            = "exempt"
	FlagBinDirectory      = "bin-directory"
	FlagConflistDirectory = "conflist-directory"
	FlagVersion           = "version"

	//CNI Log Flags
	FlagFollow      = "follow"
	FlagLogFilePath = "log-file"

	// tenancy flags
	Singletenancy = "singletenancy"
	Multitenancy  = "multitenancy"

	// os flags
	Linux   = "linux"
	Windows = "windows"

	// arch flags
	Amd64 = "amd64"

	// target mode flags
	Local   = "local"
	Cluster = "cluster"

	// File permissions
	BinPerm      = 755
	ConflistPerm = 644

	// CNI versions
	Latest   = "latest"
	Packaged = "packaged"

	AzureCNIBin          = "azure-vnet"
	AzureTelemetryBin    = "azure-vnet-telemetry"
	AzureTelemetryConfig = "azure-vnet-telemetry.config"
	AzureCNSIPAM         = "azure-cns"
	AzureVNETIPAM        = "azure-vnet-ipam"
	ConflistExtension    = ".conflist"

	DefaultSrcDirLinux      = "/output/"
	DefaultBinDirLinux      = "/opt/cni/bin/"
	DefaultConflistDirLinux = "/etc/cni/net.d/"
	DefaultLogFile          = "/var/log/azure-vnet.log"
	Transparent             = "transparent"
	Bridge                  = "bridge"
	Azure0                  = "azure0"
)

Variables

View Source
var (
	// Concatenating flags to the env ensures consistency between flags and env's for viper and cobra
	EnvCNIOS                     = EnvPrefix + "_" + strings.ToUpper(FlagOS)
	EnvCNIType                   = EnvPrefix + "_" + strings.ToUpper(FlagTenancy)
	EnvCNISourceDir              = EnvPrefix + "_" + "SRC_DIR"
	EnvCNIDestinationBinDir      = EnvPrefix + "_" + "BIN_DIR"
	EnvCNIDestinationConflistDir = EnvPrefix + "_" + "CONFLIST_DIR"
	EnvCNIIPAMType               = EnvPrefix + "_" + strings.ToUpper(FlagIPAM)
	EnvCNIMode                   = EnvPrefix + "_" + strings.ToUpper(FlagMode)
	EnvCNIExemptBins             = EnvPrefix + "_" + strings.ToUpper(FlagExempt)
	EnvCNILogFile                = EnvPrefix + "_" + "LOG_FILE"

	Defaults = map[string]string{
		FlagOS:                       Linux,
		FlagTenancy:                  Singletenancy,
		FlagIPAM:                     AzureVNETIPAM,
		FlagExempt:                   AzureTelemetryBin + "," + AzureTelemetryConfig,
		FlagMode:                     Transparent,
		FlagTarget:                   Local,
		FlagBinDirectory:             DefaultBinDirLinux,
		FlagConflistDirectory:        DefaultConflistDirLinux,
		FlagVersion:                  Packaged,
		FlagLogFilePath:              DefaultLogFile,
		EnvCNILogFile:                EnvCNILogFile,
		EnvCNISourceDir:              DefaultSrcDirLinux,
		EnvCNIDestinationBinDir:      DefaultBinDirLinux,
		EnvCNIDestinationConflistDir: DefaultConflistDirLinux,
	}

	DefaultToggles = map[string]bool{
		FlagFollow: false,
	}
)

Functions

func GetDefaults

func GetDefaults() map[string]string

func PrettyPrint

func PrettyPrint(b interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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