|
7 | 7 |
|
8 | 8 | "github.com/replicatedhq/embedded-cluster/pkg/configutils" |
9 | 9 | "github.com/replicatedhq/embedded-cluster/pkg/kotsadm" |
| 10 | + "github.com/replicatedhq/embedded-cluster/pkg/netutils" |
10 | 11 | "github.com/replicatedhq/embedded-cluster/pkg/preflights" |
11 | 12 | "github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig" |
12 | 13 | "github.com/sirupsen/logrus" |
@@ -90,12 +91,18 @@ func runJoinRunPreflights(ctx context.Context, name string, flags JoinCmdFlags, |
90 | 91 | } |
91 | 92 |
|
92 | 93 | func runJoinPreflights(ctx context.Context, jcmd *kotsadm.JoinCommandResponse, flags JoinCmdFlags, cidrCfg *CIDRConfig, metricsReported preflights.MetricsReporter) error { |
| 94 | + nodeIP, err := netutils.FirstValidAddress(flags.networkInterface) |
| 95 | + if err != nil { |
| 96 | + return fmt.Errorf("unable to find first valid address: %w", err) |
| 97 | + } |
| 98 | + |
93 | 99 | if err := preflights.PrepareAndRun(ctx, preflights.PrepareAndRunOptions{ |
94 | 100 | ReplicatedAPIURL: jcmd.InstallationSpec.MetricsBaseURL, // MetricsBaseURL is the replicated.app endpoint url |
95 | 101 | ProxyRegistryURL: fmt.Sprintf("https://%s", runtimeconfig.ProxyRegistryAddress), |
96 | 102 | Proxy: jcmd.InstallationSpec.Proxy, |
97 | 103 | PodCIDR: cidrCfg.PodCIDR, |
98 | 104 | ServiceCIDR: cidrCfg.ServiceCIDR, |
| 105 | + NodeIP: nodeIP, |
99 | 106 | IsAirgap: flags.isAirgap, |
100 | 107 | SkipHostPreflights: flags.skipHostPreflights, |
101 | 108 | IgnoreHostPreflights: flags.ignoreHostPreflights, |
|
0 commit comments