feat(dns): configure and store public IP when initialising machine

This commit is contained in:
Pavel Sviderski committed 2025-02-25 21:21:37 +10:00
1 parent d0fd9db258
commit 289d964b2a
8 files changed
+359 -228

No files matched your search

+6
View File
@@ -558,6 +558,12 @@ func (m *Machine) InitCluster(ctx context.Context, req *pb.InitClusterRequest) (
PublicKey: m.state.Network.PublicKey,
},
}
if req.GetPublicIp() != nil {
addReq.PublicIp = req.GetPublicIp()
} else if req.GetPublicIpAuto() {
addReq.PublicIp = pb.NewIP(publicIP)
}
addResp, err := m.cluster.AddMachine(ctx, addReq)
if err != nil {
return nil, status.Errorf(codes.Internal, "add machine to cluster: %v", err)