Skip to content

Commit

Permalink
Fix static network rendering for flatcar
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <[email protected]>
  • Loading branch information
ahmedwaleedmalik committed Nov 2, 2022
1 parent 04a5ee3 commit e54baed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/userdata/flatcar/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (p Provider) UserData(req plugin.UserDataRequest) (string, error) {
data := struct {
plugin.UserDataRequest
ProviderSpec *providerconfigtypes.Config
StaticIPConfigProvided bool
FlatcarConfig *Config
KubeletVersion string
Kubeconfig string
Expand All @@ -116,6 +117,7 @@ func (p Provider) UserData(req plugin.UserDataRequest) (string, error) {
}{
UserDataRequest: req,
ProviderSpec: pconfig,
StaticIPConfigProvided: pconfig.Network.IsStaticIPConfig(),
FlatcarConfig: flatcarConfig,
KubeletVersion: kubeletVersion.String(),
Kubeconfig: kubeconfigString,
Expand Down Expand Up @@ -170,7 +172,7 @@ const userDataIgnitionTemplate = `passwd:
{{end}}
{{- end }}
{{- if .ProviderSpec.Network }}
{{- if .StaticIPConfigProvided }}
networkd:
units:
- name: static-nic.network
Expand Down Expand Up @@ -544,7 +546,7 @@ users:
coreos:
units:
{{- if .ProviderSpec.Network }}
{{- if .StaticIPConfigProvided }}
- name: static-nic.network
content: |
[Match]
Expand Down

0 comments on commit e54baed

Please sign in to comment.