From f7f7e5ffde104c629a257449d20b0f3ea0ca394c Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Sat, 4 Nov 2023 23:23:50 +0100 Subject: [PATCH] grcp because rest is old school --- internal/config/config.go | 1 + internal/hetzner/hetzneragent.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index a084814..87b5dfe 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -14,6 +14,7 @@ type Config = struct { DryRun bool `default:"false" env:"WOODPECKER_AUTOSCALER_DRY_RUN"` WoodpeckerLabelSelector string `default:"uploadfilter24.eu/instance-role=Woodpecker" env:"WOODPECKER_AUTOSCALER_WOODPECKER_LABEL_SELECTOR"` WoodpeckerInstance string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_INSTANCE"` + WoodpeckerGrpc string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_GRPC"` WoodpeckerAgentSecret string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_AGENT_SECRET"` WoodpeckerApiToken string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_API_TOKEN"` HcloudToken string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_TOKEN"` diff --git a/internal/hetzner/hetzneragent.go b/internal/hetzner/hetzneragent.go index 6881480..2fdf9eb 100644 --- a/internal/hetzner/hetzneragent.go +++ b/internal/hetzner/hetzneragent.go @@ -30,7 +30,7 @@ write_files: - /var/run/docker.sock:/var/run/docker.sock environment: {{- range $key, $val := .EnvConfig }} - - {{ $key }}: {{ $val }} + - {{ $key }}="{{ $val }}" {{- end }} path: /root/docker-compose.yml runcmd: @@ -44,7 +44,8 @@ type UserDataConfig struct { func generateConfig(cfg *config.Config, name string) (string, error) { envConfig := map[string]string{} - envConfig["WOODPECKER_SERVER"] = cfg.WoodpeckerInstance + envConfig["WOODPECKER_SERVER"] = cfg.WoodpeckerGrpc + envConfig["WOODPECKER_GRPC_SECURE"] = "true" // TODO: should probably made configurable envConfig["WOODPECKER_AGENT_SECRET"] = cfg.WoodpeckerAgentSecret envConfig["WOODPECKER_FILTER_LABELS"] = cfg.WoodpeckerLabelSelector envConfig["WOODPECKER_HOSTNAME"] = name