talos/pkg/provision/providers/qemu/node_darwin.go
Orzelius 26bbddea95
fix: darwin build
update darwin specific findAPIBindAddrs func

Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
2025-08-15 17:32:11 +09:00

24 lines
754 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package qemu
import (
"context"
"net"
"github.com/siderolabs/talos/pkg/provision"
)
// findAPIBindAddrs returns the 0.0.0.0 address to bind to all interfaces on macos with a random port on macos.
// The bridge interface address is not used as the bridge is not yet created at this stage.
func (p *provisioner) findAPIBindAddrs(_ context.Context, _ provision.ClusterRequest) (*net.TCPAddr, error) {
l, err := net.Listen("tcp", net.JoinHostPort("0.0.0.0", "0"))
if err != nil {
return nil, err
}
return l.Addr().(*net.TCPAddr), l.Close()
}