Documentation ¶
Index ¶
- func ValidateFromByte(source []byte) (validator.Errors, error)
- func ValidateFromFile(path string) (validator.Errors, error)
- type Bond
- type CNIConfig
- type Config
- func (c Config) IsCIDRList(nets []string) bool
- func (c Config) IsCNIName(cni string) bool
- func (c Config) IsDomain(domain string) bool
- func (c Config) IsDomainOrIP(domainIP string) bool
- func (c Config) IsIPList(ips []string) bool
- func (c Config) IsRFC6902List(input []map[string]interface{}) bool
- func (c Config) IsSemVer(version string) bool
- func (c Config) IsSupportedK8sVersion(version string) bool
- func (c Config) IsSupportedTalosVersion(version string) bool
- func (c Config) IsTalosEndpoint(ep string) bool
- func (c Config) IsURLList(urls []string) bool
- func (c Config) IsValidFileOperation(op string) bool
- func (c Config) IsValidNetworkInterfaces(ifaces []*NetworkInterface) bool
- func (c Config) Messages() map[string]string
- type DhcpOption
- type Extension
- type InstallDiskSelector
- type KernelModule
- type MachineFile
- type NetworkDeviceSelector
- type NetworkInterface
- type Node
- type Peer
- type Route
- type Vip
- type Vlan
- type Wireguard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateFromByte ¶
ValidateFromByte reads yaml bytes and validates the data. It returns all the incorrect values and an error, if any.
Types ¶
type Bond ¶
type Bond struct { Interfaces []string `validate:"requiredWith:Nodes.NetworkInterfaces.Bond"` ArpIPTarget []string Mode string XmitHashPolicy string LacpRate string AdActorSystem string ArpValidate string Primary string PrimaryReselect string FailOverMac string AdSelect string MiiMon string `validate:"isUint"` Updelay string `validate:"isUint"` Downdelay string `validate:"isUint"` ArpInterval string `validate:"isUint"` ResendIgmp string `validate:"isUint"` MinLinks string `validate:"isUint"` LpInterval string `validate:"isUint"` PacketsPerSlave string `validate:"isUint"` NumPeerNotif string `validate:"isUint"` TlbDynamicLb string `validate:"isUint"` AllSlavesActive string `validate:"isUint"` UseCarrier string `validate:"isBool"` AdActorSysPrio string `validate:"isUint"` AdUserPortKey string `validate:"isUint"` PeerNotifyDelay string `validate:"isUint"` }
type Config ¶
type Config struct { ClusterName string `validate:"required"` TalosVersion string `validate:"isSupportedTalosVersion"` KubernetesVersion string `validate:"isSupportedK8sVersion"` Endpoint string `validate:"isTalosEndpoint"` Domain string `validate:"isDomain"` AllowSchedulingOnMasters string `validate:"isBool"` AllowSchedulingOnControlPlanes string `validate:"isBool"` ClusterPodNets []string `validate:"isCIDRList"` ClusterSvcNets []string `validate:"isCIDRList"` CniConfig *CNIConfig Nodes []*Node ControlPlane struct { ConfigPatches []map[string]interface{} `validate:"isRFC6902List"` } Worker struct { ConfigPatches []map[string]interface{} `validate:"isRFC6902List"` } }
func NewFromByte ¶
NewFromByte takes bytes and convert it into Talhelper config. It also returns an error, if any.
func NewFromFile ¶
NewFromFile takes a file path and convert the contents into Talhelper config. It also returns an error, if any.
func (Config) IsCIDRList ¶
IsCIDRList returns true if `nets` is list of CIDR addresses.
func (Config) IsDomainOrIP ¶ added in v1.4.4
IsDomainOrIP returns true if `domainIP` is either valid domain or IP.
func (Config) IsRFC6902List ¶
IsRFC6902List returns true if `input` is list of RFC6902 JSON patch.
func (Config) IsSemVer ¶ added in v1.7.0
IsSemVer returns true if `version` is a valid semantic version.
func (Config) IsSupportedK8sVersion ¶ added in v1.7.0
IsSupportedK8sVersion returns true if Kubernetes `version` is supported by `c.TalosVersion`.
func (Config) IsSupportedTalosVersion ¶ added in v1.7.0
IsSupportedTalosVersion returns true if `version` is supported Talos version.
func (Config) IsTalosEndpoint ¶
IsTalosEndpoint returns true if `ep` is a valid Talos endpoint.
func (Config) IsValidFileOperation ¶ added in v1.10.1
IsValidFileOperation returns true if `op` is a correct `machineFile` operation
func (Config) IsValidNetworkInterfaces ¶ added in v1.6.3
func (c Config) IsValidNetworkInterfaces(ifaces []*NetworkInterface) bool
IsValidNetworkInterfaces returns true if `ifaces` is list of network interfaces.
type DhcpOption ¶
type Extension ¶ added in v1.10.1
type Extension struct {
Image string `validate:"requiredWith:Nodes.Extensions"`
}
type InstallDiskSelector ¶ added in v1.4.3
type KernelModule ¶ added in v1.5.5
type MachineFile ¶ added in v1.10.1
type NetworkDeviceSelector ¶ added in v1.6.3
type NetworkInterface ¶
type NetworkInterface struct { Interface string DeviceSelector *NetworkDeviceSelector Addresses []string `validate:"isCIDRList"` Routes []Route Bond *Bond Vlans []*Vlan Mtu string `validate:"isIntString"` Dhcp string `validate:"isBool"` Ignore string `validate:"isBool"` Dummy string `validate:"isBool"` DhcpOptions *DhcpOption Wireguard *Wireguard Vip *Vip }
type Node ¶
type Node struct { Hostname string `validate:"required"` IPAddress string `validate:"required|isDomainOrIP"` ControlPlane string `validate:"isBool"` InstallDisk string `validate:"requiredWithout:Nodes.InstallDiskSelector"` DisableSearchDomain string `validate:"isBool"` Nameservers []string `validate:"isIPList"` ConfigPatches []map[string]interface{} `validate:"isRFC6902List"` NetworkInterfaces []*NetworkInterface `validate:"isValidNetworkInterfaces"` InstallDiskSelector *InstallDiskSelector KernelModules []*KernelModule NodeLabels map[string]string MachineFiles []MachineFile Extensions []Extension }