Skip to content

Commit

Permalink
add SatelliteAddress overwrite support for SH satellites too (#4052)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
idelvall authored Apr 23, 2024
1 parent 3d27390 commit 1b3bfd4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/earthly/base/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1b3bfd4

Please sign in to comment.