Skip to content

Commit ce28682

Browse files
committed
fix: drop the Omni API URL check on IP address
I don't see much point in this check, as it's only valuable when joining to a local development instance of Omni, which is pretty nice usecase. But this check breaks joining to "real" Omni which has hostname in the endpoint. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com> (cherry picked from commit 0592ff0)
1 parent 96f724a commit ce28682

2 files changed

Lines changed: 1 addition & 37 deletions

File tree

cmd/talosctl/cmd/mgmt/cluster/create/clusterops/configmaker/internal/makers/common.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,7 @@ func (m *Maker[T]) applyOmniConfigs() error {
261261

262262
cfg.APIUrlConfig.URL = parsedURL
263263

264-
mode, err := runtime.ParseMode(runtime.ModeMetal.String())
265-
if err != nil {
266-
return err
267-
}
268-
269-
_, err = cfg.Validate(mode)
264+
_, err = cfg.Validate(runtime.ModeMetal)
270265
if err != nil {
271266
return err
272267
}

cmd/talosctl/cmd/mgmt/cluster/create/create_qemu.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package create
77
import (
88
"context"
99
"fmt"
10-
"net/netip"
1110
"net/url"
1211
"os"
1312
"path/filepath"
@@ -100,13 +99,6 @@ func createQemuCluster(
10099
}
101100

102101
func preCreate(cOps clusterops.Common, clusterConfigs clusterops.ClusterConfigs) error {
103-
if cOps.OmniAPIEndpoint != "" {
104-
err := checkLoopbackOmniURL(cOps, clusterConfigs)
105-
if err != nil {
106-
return err
107-
}
108-
}
109-
110102
// write machine config
111103
if cOps.SkipInjectingConfig {
112104
if err := writeMachineconfig(clusterConfigs, cOps); err != nil {
@@ -143,26 +135,3 @@ func writeMachineconfig(clusterConfigs clusterops.ClusterConfigs, cOps clusterop
143135

144136
return nil
145137
}
146-
147-
func checkLoopbackOmniURL(cOps clusterops.Common, clusterConfigs clusterops.ClusterConfigs) error {
148-
parsedURL, err := url.Parse(cOps.OmniAPIEndpoint)
149-
if err != nil {
150-
return err
151-
}
152-
153-
host := parsedURL.Hostname()
154-
155-
ip, err := netip.ParseAddr(host)
156-
if err != nil {
157-
return err
158-
}
159-
160-
gwIP := clusterConfigs.ClusterRequest.Network.GatewayAddrs[0]
161-
162-
if ip.IsLoopback() && ip != gwIP {
163-
fmt.Fprintf(os.Stderr, "WARNING: the Omni API url is pointing to a local address %q which is different from the cluster gateway address %q\n", ip.String(), gwIP.String())
164-
fmt.Fprintln(os.Stderr, "the nodes will not be able to reach the Omni API server unless Omni is running in the same virtual network")
165-
}
166-
167-
return nil
168-
}

0 commit comments

Comments
 (0)