Skip to content

Commit 1bd717b

Browse files
authored
fix: no dnsNameservers in InfrastructureStatus in SNA case (#34)
* fix: no dnsNameservers in InfrastructureStatus in SNA case Signed-off-by: Niclas Schad <niclas.schad@stackit.cloud> * set fctx.dnsNameservers to nil when retrieving the network fails Signed-off-by: Niclas Schad <niclas.schad@stackit.cloud> --------- Signed-off-by: Niclas Schad <niclas.schad@stackit.cloud>
1 parent f678108 commit 1bd717b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controller/infrastructure/stackit/infraflow/reconcile.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func (fctx *FlowContext) ensureConfiguredNetwork(ctx context.Context) error {
9898
networkID := *fctx.config.Networks.ID
9999
network, err := fctx.iaasClient.GetNetworkById(ctx, networkID)
100100
if err != nil {
101+
fctx.dnsNameservers = nil
101102
fctx.state.Set(IdentifierNetwork, "")
102103
fctx.state.Set(NameNetwork, "")
103104
return err
@@ -130,6 +131,10 @@ func (fctx *FlowContext) ensureConfiguredNetwork(ctx context.Context) error {
130131
fctx.nodesCIDR = &snaConfig.WorkersCIDR
131132
}
132133

134+
// Populate dnsNameservers for InfrastructureStatus from provided network
135+
nameservers := networkIPv4Config.GetNameservers()
136+
fctx.dnsNameservers = ptr.To(nameservers)
137+
133138
fctx.state.Set(IdentifierNetwork, networkID)
134139
fctx.state.Set(NameNetwork, network.GetName())
135140
return nil

0 commit comments

Comments
 (0)