flag

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: Apache-2.0, BSD-3-Clause Imports: 15 Imported by: 1

Documentation

Overview

Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Copied from Go standard library's net/url package.

Index

Constants

This section is empty.

Variables

View Source
var BackendConfig = Config{
	Name:  "backend",
	Usage: "backend to use (kube, file, none)",
}

BackendConfig flags.

View Source
var BackendFilePath = Config{
	Name:  "backend-file-path",
	Usage: "path to the file backend",
}
View Source
var BackendKubeConfig = Config{
	Name:  "backend-kube-config",
	Usage: "path to the kubeconfig file",
}
View Source
var BackendKubeNamespace = Config{
	Name:  "backend-kube-namespace",
	Usage: "namespace to watch for resources",
}
View Source
var DHCPBindAddr = Config{
	Name:  "dhcp-bind-addr",
	Usage: "[dhcp] DHCP server bind address",
}
View Source
var DHCPBindInterface = Config{
	Name:  "dhcp-bind-interface",
	Usage: "[dhcp] DHCP server bind interface",
}
View Source
var DHCPEnabled = Config{
	Name:  "dhcp-enabled",
	Usage: "[dhcp] enable DHCP server",
}

DHCP flags.

View Source
var DHCPIPForPacket = Config{
	Name:  "dhcp-ip-for-packet",
	Usage: "[dhcp] DHCP server IP for packet",
}
View Source
var DHCPIPXEHTTPBinaryURLHost = Config{
	Name:  "dhcp-ipxe-http-binary-host",
	Usage: "[dhcp] HTTP iPXE binaries host or IP to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPBinaryURLPath = Config{
	Name:  "dhcp-ipxe-http-binary-path",
	Usage: "[dhcp] HTTP iPXE binaries path to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPBinaryURLPort = Config{
	Name:  "dhcp-ipxe-http-binary-port",
	Usage: "[dhcp] HTTP iPXE binaries port to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPBinaryURLScheme = Config{
	Name:  "dhcp-ipxe-http-binary-scheme",
	Usage: "[dhcp] HTTP iPXE binaries scheme to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPScriptHost = Config{
	Name:  "dhcp-ipxe-http-script-host",
	Usage: "[dhcp] HTTP iPXE script host or IP to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPScriptInjectMac = Config{
	Name:  "dhcp-ipxe-http-script-prepend-mac",
	Usage: "[dhcp] prepend the hardware MAC address to iPXE script URL base, http://1.2.3.4/auto.ipxe -> http://1.2.3.4/40:15:ff:89:cc:0e/auto.ipxe",
}
View Source
var DHCPIPXEHTTPScriptPath = Config{
	Name:  "dhcp-ipxe-http-script-path",
	Usage: "[dhcp] HTTP iPXE script path to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPScriptPort = Config{
	Name:  "dhcp-ipxe-http-script-port",
	Usage: "[dhcp] HTTP iPXE script port to use in DHCP packets",
}
View Source
var DHCPIPXEHTTPScriptScheme = Config{
	Name:  "dhcp-ipxe-http-script-scheme",
	Usage: "[dhcp] HTTP iPXE script scheme to use in DHCP packets",
}
View Source
var DHCPModeFlag = Config{
	Name:  "dhcp-mode",
	Usage: fmt.Sprintf("[dhcp] DHCP mode (%s, %s, %s)", smee.DHCPModeReservation, smee.DHCPModeProxy, smee.DHCPModeAutoProxy),
}
View Source
var DHCPSyslogIP = Config{
	Name:  "dhcp-syslog-ip",
	Usage: "[dhcp] Syslog server IP address to use in DHCP packets (opt 7)",
}
View Source
var DHCPTftpIP = Config{
	Name:  "dhcp-tftp-ip",
	Usage: "[dhcp] TFTP server IP address to use in DHCP packets (opt 66, etc)",
}
View Source
var DHCPTftpPort = Config{
	Name:  "dhcp-tftp-port",
	Usage: "[dhcp] TFTP server port to use in DHCP packets (opt 66, etc)",
}
View Source
var EnableCRDMigrations = Config{
	Name:  "enable-crd-migrations",
	Usage: "create CRDs in the cluster",
}
View Source
var EnableETCD = Config{
	Name:  "enable-embedded-etcd",
	Usage: "enables the embedded etcd",
}
View Source
var EnableKubeAPIServer = Config{
	Name:  "enable-embedded-kube-apiserver",
	Usage: "enables the embedded kube-apiserver",
}
View Source
var EnableRufioController = Config{
	Name:  "enable-rufio-controller",
	Usage: "enable Rufio Controller service",
}
View Source
var EnableSecondStar = Config{
	Name:  "enable-secondstar",
	Usage: "enable SecondStar service",
}
View Source
var EnableSmee = Config{
	Name:  "enable-smee",
	Usage: "enable Smee service",
}
View Source
var EnableTinkController = Config{
	Name:  "enable-tink-controller",
	Usage: "enable Tink Controller service",
}
View Source
var EnableTinkServer = Config{
	Name:  "enable-tink-server",
	Usage: "enable Tink Server service",
}
View Source
var EnableTootles = Config{
	Name:  "enable-tootles",
	Usage: "enable Tootles service",
}
View Source
var IPXEEmbeddedScriptPatch = Config{
	Name:  "ipxe-embedded-script-patch",
	Usage: "[ipxe] iPXE script fragment to patch into served iPXE binaries served via TFTP or HTTP",
}

iPXE flags.

View Source
var IPXEHTTPBinaryEnabled = Config{
	Name:  "ipxe-http-binary-enabled",
	Usage: "[ipxe] enable iPXE HTTP binary server",
}

iPXE HTTP binary flags.

View Source
var IPXEHTTPScriptBindAddr = Config{
	Name:  "ipxe-http-script-bind-addr",
	Usage: "[ipxe] local IP to listen on for iPXE HTTP script requests",
}
View Source
var IPXEHTTPScriptBindPort = Config{
	Name:  "ipxe-http-script-bind-port",
	Usage: "[ipxe] local port to listen on for iPXE HTTP script requests",
}
View Source
var IPXEHTTPScriptEnabled = Config{
	Name:  "ipxe-http-script-enabled",
	Usage: "[ipxe] enable iPXE HTTP script serving",
}

iPXE HTTP script flags.

View Source
var IPXEHTTPScriptExtraKernelArgs = Config{
	Name:  "ipxe-http-script-extra-kernel-args",
	Usage: "[ipxe] extra set of kernel args (k=v k=v) that are appended to the kernel cmdline iPXE script",
}
View Source
var IPXEHTTPScriptOSIEURL = Config{
	Name:  "ipxe-http-script-osie-url",
	Usage: "[ipxe] URL where OSIE (HookOS) images are located",
}
View Source
var IPXEHTTPScriptRetries = Config{
	Name:  "ipxe-http-script-retries",
	Usage: "[ipxe] number of retries to attempt when fetching kernel and initrd files in the iPXE script",
}
View Source
var IPXEHTTPScriptRetryDelay = Config{
	Name:  "ipxe-http-script-retry-delay",
	Usage: "[ipxe] delay (in seconds) between retries when fetching kernel and initrd files in the iPXE script",
}
View Source
var IPXEHTTPScriptTrustedProxies = Config{
	Name:  "ipxe-http-script-trusted-proxies",
	Usage: "[ipxe] comma separated list of trusted proxies in CIDR notation",
}
View Source
var ISOEnabled = Config{
	Name:  "iso-enabled",
	Usage: "[iso] enable OSIE ISO patching service",
}

ISO flags.

View Source
var ISOPatchMagicString = Config{
	Name:  "iso-patch-magic-string",
	Usage: "[iso] the string pattern to match for in the source (upstream) ISO, defaults to the one defined in HookOS",
}
View Source
var ISOStaticIPAMEnabled = Config{
	Name:  "iso-static-ipam-enabled",
	Usage: "[iso] enable static IPAM when patching the source (upstream) ISO",
}
View Source
var ISOUpstreamURL = Config{
	Name:  "iso-upstream-url",
	Usage: "[iso] an ISO source (upstream) URL target for patching kernel command line parameters",
}
View Source
var LogLevelConfig = Config{
	Name:  "log-level",
	Usage: "the higher the number the more verbose",
}

All these flags are used by at least two services or are used to create objects that are used by multiple services.

View Source
var OTELEndpoint = Config{
	Name:  "otel-endpoint",
	Usage: "[otel] OpenTelemetry collector endpoint",
}

OTEL flags.

View Source
var OTELInsecure = Config{
	Name:  "otel-insecure",
	Usage: "[otel] OpenTelemetry collector insecure",
}
View Source
var PublicIP = Config{
	Name:  "public-ipv4",
	Usage: "public IPv4 address to use for all enabled services",
}
View Source
var RufioBMCConnectTimeout = Config{
	Name:  "rufio-bmc-connect-timeout",
	Usage: "timeout for BMC connection",
}
View Source
var RufioControllerEnableLeaderElection = Config{
	Name:  "rufio-controller-enable-leader-election",
	Usage: "enable leader election for controller manager",
}
View Source
var RufioControllerLeaderElectionNamespace = Config{
	Name:  "rufio-controller-leader-election-namespace",
	Usage: "namespace in which the leader election lease will be created",
}
View Source
var RufioControllerMetricsAddr = Config{
	Name:  "rufio-controller-metrics-addr",
	Usage: "address on which to expose metrics",
}
View Source
var RufioControllerProbeAddr = Config{
	Name:  "rufio-controller-probe-addr",
	Usage: "address on which to expose health probes",
}
View Source
var RufioLogLevel = Config{
	Name:  "rufio-log-level",
	Usage: "the higher the number the more verbose, level 0 inherits the global log level",
}
View Source
var RufioPowerCheckInterval = Config{
	Name:  "rufio-power-check-interval",
	Usage: "interval at which the machine's power state is reconciled",
}
View Source
var SecondStarHostKey = Config{
	Name:  "secondstar-host-key",
	Usage: "Path to the host key file for SecondStar",
}
View Source
var SecondStarIPMIToolPath = Config{
	Name:  "secondstar-ipmitool-path",
	Usage: "Path to the ipmitool binary",
}
View Source
var SecondStarIdleTimeout = Config{
	Name:  "secondstar-idle-timeout",
	Usage: "Idle timeout for SecondStar",
}
View Source
var SecondStarLogLevel = Config{
	Name:  "secondstar-log-level",
	Usage: "the higher the number the more verbose, level 0 inherits the global log level",
}
View Source
var SecondStarPort = Config{
	Name:  "secondstar-port",
	Usage: "Port to listen on for SecondStar",
}
View Source
var SmeeLogLevel = Config{
	Name:  "smee-log-level",
	Usage: "the higher the number the more verbose, level 0 inherits the global log level",
}
View Source
var SyslogBindAddr = Config{
	Name:  "syslog-bind-addr",
	Usage: "[syslog] local IP to listen on for Syslog messages",
}
View Source
var SyslogBindPort = Config{
	Name:  "syslog-bind-port",
	Usage: "[syslog] local port to listen on for Syslog messages",
}
View Source
var SyslogEnabled = Config{
	Name:  "syslog-enabled",
	Usage: "[syslog] enable Syslog server(receiver)",
}

Syslog flags.

View Source
var TFTPBlockSize = Config{
	Name:  "tftp-block-size",
	Usage: "[tftp] TFTP block size a value between 512 (the default block size for TFTP) and 65456 (the max size a UDP packet payload can be)",
}
View Source
var TFTPServerBindAddr = Config{
	Name:  "tftp-server-bind-addr",
	Usage: "[tftp] local IP to listen on for iPXE binary TFTP requests",
}
View Source
var TFTPServerBindPort = Config{
	Name:  "tftp-server-bind-port",
	Usage: "[tftp] local port to listen on for iPXE binary TFTP requests",
}
View Source
var TFTPServerEnabled = Config{
	Name:  "tftp-server-enabled",
	Usage: "[tftp] enable iPXE TFTP binary server",
}

TFTP flags.

View Source
var TFTPTimeout = Config{
	Name:  "tftp-timeout",
	Usage: "[tftp] timeout (in seconds) for TFTP requests",
}
View Source
var TinkControllerEnableLeaderElection = Config{
	Name:  "tink-controller-enable-leader-election",
	Usage: "enable leader election for controller manager",
}
View Source
var TinkControllerLeaderElectionNamespace = Config{
	Name:  "tink-controller-leader-election-namespace",
	Usage: "namespace in which the leader election lease will be created",
}
View Source
var TinkControllerLogLevel = Config{
	Name:  "tink-controller-log-level",
	Usage: "the higher the number the more verbose, level 0 inherits the global log level",
}
View Source
var TinkControllerMetricsAddr = Config{
	Name:  "tink-controller-metrics-addr",
	Usage: "address on which to expose metrics",
}
View Source
var TinkControllerProbeAddr = Config{
	Name:  "tink-controller-probe-addr",
	Usage: "address on which to expose health probes",
}
View Source
var TinkServerAddrPort = Config{
	Name:  "ipxe-script-tink-server-addr-port",
	Usage: "[tink] Tink server address and port",
}

Tink Server flags.

View Source
var TinkServerBindAddr = Config{
	Name:  "tink-server-bind-addr",
	Usage: "ip address on which the Tink server will listen",
}
View Source
var TinkServerBindPort = Config{
	Name:  "tink-server-bind-port",
	Usage: "port on which the Tink server will listen",
}
View Source
var TinkServerInsecureTLS = Config{
	Name:  "ipxe-script-tink-server-insecure-tls",
	Usage: "[tink] Skip TLS verification when connecting to the Tink server",
}
View Source
var TinkServerLogLevel = Config{
	Name:  "tink-server-log-level",
	Usage: "the higher the number the more verbose, level 0 inherits the global log level",
}
View Source
var TinkServerUseTLS = Config{
	Name:  "ipxe-script-tink-server-use-tls",
	Usage: "[tink] Use TLS to connect to the Tink server",
}
View Source
var TootlesBindAddr = Config{
	Name:  "tootles-bind-addr",
	Usage: "ip address on which the Tootles service will listen",
}
View Source
var TootlesBindPort = Config{
	Name:  "tootles-bind-port",
	Usage: "port on which the Tootles service will listen",
}
View Source
var TootlesDebugMode = Config{
	Name:  "tootles-debug-mode",
	Usage: "whether to run Tootles in debug mode",
}
View Source
var TootlesLogLevel = Config{
	Name:  "tootles-log-level",
	Usage: "the higher the number the more verbose, level 0 inherits the global log level",
}
View Source
var TrustedProxies = Config{
	Name:  "trusted-proxies",
	Usage: "list of trusted proxies in CIDR notation",
}

Shared flags.

Functions

func RegisterEmbeddedGlobals added in v0.17.1

func RegisterEmbeddedGlobals(fs *Set, gc *GlobalConfig)

func RegisterGlobal

func RegisterGlobal(fs *Set, gc *GlobalConfig)

func RegisterRufioFlags

func RegisterRufioFlags(fs *Set, t *RufioConfig)

func RegisterSecondStarFlags

func RegisterSecondStarFlags(fs *Set, ssc *SecondStarConfig)

func RegisterSmeeFlags

func RegisterSmeeFlags(fs *Set, sc *SmeeConfig)

func RegisterTinkControllerFlags

func RegisterTinkControllerFlags(fs *Set, t *TinkControllerConfig)

func RegisterTinkServerFlags

func RegisterTinkServerFlags(fs *Set, t *TinkServerConfig)

func RegisterTootlesFlags

func RegisterTootlesFlags(fs *Set, h *TootlesConfig)

Types

type Config

type Config struct {
	Name  string
	Usage string
}

Config defines the configuration for a flag.

type EmbeddedGlobalConfig

type EmbeddedGlobalConfig struct {
	EnableKubeAPIServer bool
	EnableETCD          bool
}

type GlobalConfig

type GlobalConfig struct {
	LogLevel             int
	Backend              string
	BackendFilePath      string
	BackendKubeConfig    string
	BackendKubeNamespace string
	OTELEndpoint         string
	OTELInsecure         bool
	TrustedProxies       []netip.Prefix
	PublicIP             netip.Addr
	EnableSmee           bool
	EnableTootles        bool
	EnableTinkServer     bool
	EnableTinkController bool
	EnableRufio          bool
	EnableSecondStar     bool
	EnableCRDMigrations  bool
	EmbeddedGlobalConfig EmbeddedGlobalConfig
}

type RufioConfig

type RufioConfig struct {
	Config   *rufio.Config
	LogLevel int
}

type SecondStarConfig

type SecondStarConfig struct {
	Config      *secondstar.Config
	HostKeyPath string
	LogLevel    int
}

func (*SecondStarConfig) Convert

func (ssc *SecondStarConfig) Convert() error

type Set

type Set struct {
	*ff.FlagSet
}

Set is a wrapper around ff.FlagSet that allows for helper methods to be created.

func (*Set) Register

func (fs *Set) Register(f Config, fv flag.Value)

Register registers a flag with the provided flag set. This will panic if the flag is unable to be added to the flag set, like for a duplicate name.

type SmeeConfig

type SmeeConfig struct {
	Config *smee.Config
	// DHCPIPXEBinary splits out some url.URL fields so they can be set individually.
	// The cmd package is responsible for putting the fields back together into a url.URL for use in service package configs.
	DHCPIPXEBinary URLBuilder
	// DHCPIPXEScript splits out some url.URL fields so they can be set individually.
	// The cmd package is responsible for putting the fields back together into a url.URL for use in service package configs.
	DHCPIPXEScript URLBuilder
	LogLevel       int
}

func (*SmeeConfig) Convert

func (s *SmeeConfig) Convert(trustedProxies *[]netip.Prefix, publicIP netip.Addr)

Convert CLI specific fields to smee.Config fields.

type TinkControllerConfig

type TinkControllerConfig struct {
	Config   *controller.Config
	LogLevel int
}

type TinkServerConfig

type TinkServerConfig struct {
	Config   *server.Config
	BindAddr netip.Addr
	BindPort uint16
	LogLevel int
}

func (*TinkServerConfig) Convert

func (t *TinkServerConfig) Convert()

Convert TinkServerConfig data types to tink server server.Config data types.

type TootlesConfig

type TootlesConfig struct {
	Config   *tootles.Config
	BindAddr netip.Addr
	BindPort int
	LogLevel int
}

func (*TootlesConfig) Convert

func (h *TootlesConfig) Convert(trustedProxies *[]netip.Prefix)

Convert converts TootlesConfig data types to tootles.Config data types.

type URLBuilder

type URLBuilder struct {
	// Host is required.
	Host string
	// Port is optional.
	Port int
}

URLBuilder breaks out the fields of a url.URL so they can be set individually from the CLI.

Jump to

Keyboard shortcuts

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