mirror of
https://github.com/siderolabs/talos.git
synced 2025-09-29 01:31:11 +02:00
update darwin specific findAPIBindAddrs func Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
24 lines
754 B
Go
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()
|
|
}
|