From 24be598758ef4a97200cb19e8d8d89c49d53cd35 Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Wed, 8 Nov 2023 22:01:20 +0100 Subject: [PATCH] make ip version configurable --- internal/config/config.go | 1 + internal/hetzner/hetzneragent.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index 09befec..cb822d9 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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) { diff --git a/internal/hetzner/hetzneragent.go b/internal/hetzner/hetzneragent.go index 0521e40..264362b 100644 --- a/internal/hetzner/hetzneragent.go +++ b/internal/hetzner/hetzneragent.go @@ -94,7 +94,7 @@ func CreateNewAgent(cfg *config.Config) (*hcloud.Server, error) { } networkConf := hcloud.ServerCreatePublicNet{ - EnableIPv4: false, + EnableIPv4: !cfg.HcloudIPv6Only, EnableIPv6: true, }