Skip to content

Commit

Permalink
fix cloud-init default routes
Browse files Browse the repository at this point in the history
  • Loading branch information
pborn-ionos committed Dec 14, 2023
1 parent 1b0555f commit 15e19bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/cloudinit/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const (
{{- end }}
routes:
{{- if $element.Gateway }}
- to: default
- to: 0.0.0.0/0
via: {{ $element.Gateway }}
{{- end }}
{{- if $element.Gateway6 }}
- to: default
- to: '::/0'
via: {{ $element.Gateway6 }}
{{- end }}
{{- if $element.DNSServers }}
Expand Down
14 changes: 7 additions & 7 deletions pkg/cloudinit/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
addresses:
- 10.10.10.12/24
routes:
- to: default
- to: 0.0.0.0/0
via: 10.10.10.1
nameservers:
addresses:
Expand All @@ -53,7 +53,7 @@ const (
addresses:
- 10.10.10.12/24
routes:
- to: default
- to: 0.0.0.0/0
via: 10.10.10.1`

expectedValidNetworkConfigMultipleNics = `network:
Expand All @@ -67,7 +67,7 @@ const (
addresses:
- 10.10.10.12/24
routes:
- to: default
- to: 0.0.0.0/0
via: 10.10.10.1
nameservers:
addresses:
Expand All @@ -80,7 +80,7 @@ const (
addresses:
- 196.168.100.124/24
routes:
- to: default
- to: 0.0.0.0/0
via: 196.168.100.254
nameservers:
addresses:
Expand All @@ -99,9 +99,9 @@ const (
- 10.10.10.12/24
- 2001:db8::1/64
routes:
- to: default
- to: 0.0.0.0/0
via: 10.10.10.1
- to: default
- to: '::/0'
via: 2001:db8::1
nameservers:
addresses:
Expand All @@ -119,7 +119,7 @@ const (
addresses:
- 2001:db8::1/64
routes:
- to: default
- to: '::/0'
via: 2001:db8::1
nameservers:
addresses:
Expand Down

0 comments on commit 15e19bc

Please sign in to comment.