make ip version configurable
All checks were successful
Pipeline was successful

This commit is contained in:
Tobias Trabelsi 2023-11-08 22:01:20 +01:00
parent be83d204dc
commit 24be598758
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ type Config = struct {
HcloudRegion string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_REGION"`
HcloudDatacenter string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_DATACENTER"`
HcloudSSHKeys string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_SSH_KEYS"`
HcloudIPv6Only bool `default:"false" env:"WOODPECKER_AUTOSCALER_HCLOUD_IPV6_ONLY"`
}
func GenConfig() (cfg *Config, err error) {

View File

@ -94,7 +94,7 @@ func CreateNewAgent(cfg *config.Config) (*hcloud.Server, error) {
}
networkConf := hcloud.ServerCreatePublicNet{
EnableIPv4: false,
EnableIPv4: !cfg.HcloudIPv6Only,
EnableIPv6: true,
}