Move DNS topology setup earlier in cluster creation

This is needed because setting the bastion public name field depends on the DNS topology.
We were incorrectly setting bastion.publicName for dns=none clusters because the dns=none field wasn't yet set on the cluster.
This commit is contained in:
Peter Rifel 2024-02-10 14:17:35 -06:00
parent 446f3acaf1
commit ac13fa610c
No known key found for this signature in database
1 changed files with 6 additions and 4 deletions

View File

@ -1267,6 +1267,12 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
}
cluster.Spec.Networking.Topology = &api.TopologySpec{}
err := setupDNSTopology(opt, cluster)
if err != nil {
return nil, err
}
switch opt.Topology {
case api.TopologyPublic:
@ -1405,10 +1411,6 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
}
}
err := setupDNSTopology(opt, cluster)
if err != nil {
return nil, err
}
return bastions, nil
}