mirror of
https://github.com/lingble/talos.git
synced 2025-12-15 20:17:05 +00:00
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:
committed by
Andrew Rynhard
parent
71e8a5fccf
commit
f7ad24ec4f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user