talos/pkg/resources/network/configlayer.go
Andrey Smirnov 071f044562 feat: implement AddressSpec handling
This includes multiple controllers responsible for different stages of
`AddressSpec` conversion:

* `AddressConfigController` produces initial unmerged configuration from
multiple sources (more sources coming later, e.g. DHCP)
* `AddressMergeController` merges address configuration into final
representation
* `AddressSpecController` syncs resources with kernel state

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-05-14 02:27:12 -07:00

25 lines
844 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package network
//go:generate stringer -type=ConfigLayer -linecomment
// ConfigLayer describes network configuration layers, with lowest priority first.
type ConfigLayer int
// Configuration layers.
const (
ConfigDefault ConfigLayer = iota // default
ConfigCmdline // cmdline
ConfigDHCP // dhcp
ConfigPlatform // platform
ConfigMachineConfiguration // configuration
)
// MarshalYAML implements yaml.Marshaler.
func (layer ConfigLayer) MarshalYAML() (interface{}, error) {
return layer.String(), nil
}