From 1b3bfd421ad54c04ece9134bc822dc6dc3b5fc1d Mon Sep 17 00:00:00 2001 From: Ignacio del Valle Alles Date: Tue, 23 Apr 2024 02:43:02 +0200 Subject: [PATCH] add SatelliteAddress overwrite support for SH satellites too (#4052) The GH SH runner needs to call the satellite through `earthly.local` hostname. This PR makes possible overwriting the satellite address also for SH satellites. --- cmd/earthly/base/buildkit.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/earthly/base/buildkit.go b/cmd/earthly/base/buildkit.go index c385e4a6..3e62f48f 100644 --- a/cmd/earthly/base/buildkit.go +++ b/cmd/earthly/base/buildkit.go @@ -88,16 +88,15 @@ func (cli *CLI) ConfigureSatellite(cliCtx *cli.Context, cloudClient *cloud.Clien } else { cli.Console().Warnf("TLS has been disabled; this should never be done when connecting to Earthly's production API\n") } - + cli.Flags().BuildkitdSettings.SatelliteName = satelliteName + cli.Flags().BuildkitdSettings.SatelliteDisplayName = cli.Flags().SatelliteName + cli.Flags().BuildkitdSettings.SatelliteOrgID = orgID cli.Flags().BuildkitdSettings.SatelliteIsManaged = sat.IsManaged satelliteAddress := cli.Flags().SatelliteAddress - if !sat.IsManaged { + if !sat.IsManaged && satelliteAddress == "" { // A self-hosted satellite uses its own address satelliteAddress = fmt.Sprintf("tcp://%s", sat.Address) } - cli.Flags().BuildkitdSettings.SatelliteName = satelliteName - cli.Flags().BuildkitdSettings.SatelliteDisplayName = cli.Flags().SatelliteName - cli.Flags().BuildkitdSettings.SatelliteOrgID = orgID if satelliteAddress != "" { cli.Flags().BuildkitdSettings.BuildkitAddress = satelliteAddress } else {