Skip to content

Commit

Permalink
generators/cloud-init: Fix network-config
Browse files Browse the repository at this point in the history
This fixes a bug where cloud-init.network-config wouldn't be used if it
was set.

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
  • Loading branch information
monstermunchkin committed Jan 5, 2022
1 parent 2a631aa commit 72f7e89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions generators/cloud-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,7 @@ config:
{{- config_get("user.network-config", "") -}}
{%- endif -%}
{%- else -%}
version: 1
config:
- type: physical
name: {% if instance.type == "virtual-machine" %}enp5s0{% else %}eth0{% endif %}
subnets:
- type: dhcp
control: auto
{{- config_get("cloud-init.network-config", "") -}}
{%- endif %}
`
default:
Expand Down
8 changes: 1 addition & 7 deletions generators/cloud-init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,7 @@ config:
{{- config_get("user.network-config", "") -}}
{%- endif -%}
{%- else -%}
version: 1
config:
- type: physical
name: {% if instance.type == "virtual-machine" %}enp5s0{% else %}eth0{% endif %}
subnets:
- type: dhcp
control: auto
{{- config_get("cloud-init.network-config", "") -}}
{%- endif %}
`,
false,
Expand Down

0 comments on commit 72f7e89

Please sign in to comment.