fix image query
All checks were successful
Pipeline was successful

This commit is contained in:
Tobias Trabelsi 2023-11-04 21:32:38 +01:00
parent 80686523f5
commit 3280b21f9b
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E

View File

@ -68,7 +68,7 @@ func CreateNewAgent(cfg *config.Config) (*hcloud.Server, error) {
client := hcloud.NewClient(hcloud.WithToken(cfg.HcloudToken)) client := hcloud.NewClient(hcloud.WithToken(cfg.HcloudToken))
name := fmt.Sprintf("woodpecker-autoscaler-agent-%s", utils.RandStringBytes(5)) name := fmt.Sprintf("woodpecker-autoscaler-agent-%s", utils.RandStringBytes(5))
userdata, err := generateConfig(cfg, name) userdata, err := generateConfig(cfg, name)
img, _, err := client.Image.GetByNameAndArchitecture(context.Background(), "docker-ce", "amd64") img, _, err := client.Image.GetByNameAndArchitecture(context.Background(), "docker-ce", "x86")
loc, _, err := client.Location.GetByName(context.Background(), cfg.HcloudRegion) loc, _, err := client.Location.GetByName(context.Background(), cfg.HcloudRegion)
pln, _, err := client.ServerType.GetByName(context.Background(), cfg.HcloudInstanceType) pln, _, err := client.ServerType.GetByName(context.Background(), cfg.HcloudInstanceType)
key, _, err := client.SSHKey.GetByName(context.Background(), cfg.HcloudSSHKey) key, _, err := client.SSHKey.GetByName(context.Background(), cfg.HcloudSSHKey)