engine: resources: Add hetzner:vm resource

Hetzner cloud resource using hcloud-go. Requires polling via Meta:poll param. This first commit provides a stable vm resource with support for the basic functions of creating, deleting and updating a live server instance. SSH key handling does still require some attention to make sure checkapply can detect and update live changes to the specified keylist. A dedicated hetzner:sshkeys resource might be in order to make sure the keyset is handled correctly if there are multiple hetzner:vm resources running under the same Hetzner project. All remarks for future improvements are indicated with a TODO prefix
This commit is contained in:
Jef Masereel
2022-02-02 16:02:16 +00:00
committed by James Shubin
parent 0ab2406db9
commit b26f842de1
4 changed files with 1318 additions and 1 deletions

10
go.mod
View File

@@ -6,6 +6,7 @@ require (
cloud.google.com/go v0.54.0 // indirect
github.com/Microsoft/go-winio v0.4.17 // indirect
github.com/aws/aws-sdk-go v1.40.49
github.com/blynn/nex v0.0.0-20210330102341-1a3320dab988 // indirect
github.com/containerd/containerd v1.4.9 // indirect
github.com/coredhcp/coredhcp v0.0.0-20210830115404-2176f33418f4
github.com/coreos/go-systemd/v22 v22.3.2
@@ -16,6 +17,8 @@ require (
github.com/docker/docker v20.10.8+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.4.0 // indirect
github.com/dvyukov/go-fuzz v0.0.0-20220220162807-a217d9bdbece // indirect
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.1
github.com/godbus/dbus/v5 v5.0.4
github.com/google/uuid v1.2.0 // indirect
@@ -23,8 +26,10 @@ require (
github.com/hashicorp/consul/api v1.1.0
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/hil v0.0.0-20210521165536-27a72121fd40
github.com/hetznercloud/hcloud-go v1.33.1
github.com/iancoleman/strcase v0.2.0
github.com/insomniacslk/dhcp v0.0.0-20210827173440-b95caade3eac
github.com/kevinburke/go-bindata v3.23.0+incompatible // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/kylelemons/godebug v1.1.0
github.com/libvirt/libvirt-go v7.4.0+incompatible
@@ -41,6 +46,7 @@ require (
github.com/sanity-io/litter v1.5.1
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.5.1
github.com/stephens2424/writerset v1.0.2 // indirect
github.com/urfave/cli/v2 v2.3.0
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852
go.etcd.io/etcd/api/v3 v3.5.0
@@ -48,8 +54,10 @@ require (
go.etcd.io/etcd/client/v3 v3.5.0
go.etcd.io/etcd/server/v3 v3.5.0
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
golang.org/x/tools v0.1.9 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.0.3 // indirect