mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-12 09:37:14 +02:00
Get outbound IP in multiple ways or disable cache server if failed to init (#74)
Fix #64 (incompletely). It's still not ideal. It makes more sense to use the gateway IP address of container network as outbound IP of cache server. However, this requires act to cooperate, some think like: - act creates the network for new container, and returns the network to runner. - runner extracts the gateway IP in the network. - runner uses the gateway IP as outbound IP, and pass it to act as cache server endpoint. - act It continues to create the container with the created network. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/74 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -52,12 +52,6 @@ func runDaemon(ctx context.Context, envFile string) func(cmd *cobra.Command, arg
|
||||
}
|
||||
}
|
||||
|
||||
handler, err := artifactcache.NewHandler()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("cache handler listens on: %v", handler.ExternalURL())
|
||||
|
||||
var g errgroup.Group
|
||||
|
||||
cli := client.New(
|
||||
@ -75,7 +69,13 @@ func runDaemon(ctx context.Context, envFile string) func(cmd *cobra.Command, arg
|
||||
Environ: cfg.Runner.Environ,
|
||||
Labels: cfg.Runner.Labels,
|
||||
Version: version,
|
||||
CacheHandler: handler,
|
||||
}
|
||||
|
||||
if handler, err := artifactcache.NewHandler(); err != nil {
|
||||
log.Errorf("cannot init cache server, it will be disabled: %v", err)
|
||||
} else {
|
||||
log.Infof("cache handler listens on: %v", handler.ExternalURL())
|
||||
runner.CacheHandler = handler
|
||||
}
|
||||
|
||||
poller := poller.New(
|
||||
|
Reference in New Issue
Block a user