feat: allow network interface to be ignored

Added a property to userdata to allow a network interface to be ignored,
such that Talos will perform no operations on it (including DHCP).

Also added kernel commandline parameter (talos.network.interface.ignore)
to specify a network interface should be ignored.

Also allows chaining of kernel cmdline parameter Contains() where the
parameter in question does not exist.

Fixes #1124

Signed-off-by: Seán C McCord <ulexus@gmail.com>
This commit is contained in:
Seán C McCord
2019-09-07 16:34:14 -04:00
committed by Andrew Rynhard
parent 71e8a5fccf
commit f7ad24ec4f
8 changed files with 51 additions and 1 deletions

View File

@@ -82,6 +82,10 @@ func (v *Parameter) First() *string {
// Get attempts to get a string from a value's internal representation.
func (v *Parameter) Get(idx int) *string {
if v == nil {
return nil
}
if len(v.values) > idx {
return &v.values[idx]
}
@@ -91,6 +95,10 @@ func (v *Parameter) Get(idx int) *string {
// Contains returns a boolean indicating the existence of a value.
func (v *Parameter) Contains(s string) (ok bool) {
if v == nil {
return ok
}
for _, value := range v.values {
if ok = s == value; ok {
return ok