diff --git a/builder/hcloud/step_create_server_test.go b/builder/hcloud/step_create_server_test.go index 85b273a6..e673ab79 100644 --- a/builder/hcloud/step_create_server_test.go +++ b/builder/hcloud/step_create_server_test.go @@ -41,9 +41,9 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) - assert.Equal(t, "cpx11", payload.ServerType) + assert.Equal(t, "cpx11", payload.ServerType.Name) assert.True(t, payload.PublicNet.EnableIPv4) assert.True(t, payload.PublicNet.EnableIPv6) assert.Nil(t, payload.Networks) @@ -119,9 +119,9 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) - assert.Equal(t, "cpx11", payload.ServerType) + assert.Equal(t, "cpx11", payload.ServerType.Name) assert.Equal(t, int64(986532), payload.Firewalls[0].Firewall) }, Status: 201, @@ -189,9 +189,9 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) - assert.Equal(t, "cpx11", payload.ServerType) + assert.Equal(t, "cpx11", payload.ServerType.Name) assert.Equal(t, []int64{12}, payload.Networks) }, Status: 201, @@ -287,9 +287,9 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) - assert.Equal(t, "cpx11", payload.ServerType) + assert.Equal(t, "cpx11", payload.ServerType.Name) assert.Nil(t, payload.Networks) assert.NotNil(t, payload.PublicNet) assert.Equal(t, int64(1), payload.PublicNet.IPv4ID) @@ -393,9 +393,9 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) - assert.Equal(t, "cpx11", payload.ServerType) + assert.Equal(t, "cpx11", payload.ServerType.Name) assert.Nil(t, payload.Networks) assert.NotNil(t, payload.PublicNet) assert.Equal(t, int64(1), payload.PublicNet.IPv4ID) diff --git a/go.mod b/go.mod index c7c2d37f..a119873d 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.23.2 require ( github.com/hashicorp/hcl/v2 v2.22.0 github.com/hashicorp/packer-plugin-sdk v0.5.4 - github.com/hetznercloud/hcloud-go/v2 v2.15.0 + github.com/hetznercloud/hcloud-go/v2 v2.16.0 github.com/mitchellh/mapstructure v1.5.0 github.com/stretchr/testify v1.9.0 github.com/zclconf/go-cty v1.15.0 diff --git a/go.sum b/go.sum index a3560f3c..128ee9d0 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hetznercloud/hcloud-go/v2 v2.15.0 h1:6mpMJ/RuX1woZj+MCJdyKNEX9129KDkEIDeeyfr4GD4= -github.com/hetznercloud/hcloud-go/v2 v2.15.0/go.mod h1:h8sHav+27Xa+48cVMAvAUMELov5h298Ilg2vflyTHgg= +github.com/hetznercloud/hcloud-go/v2 v2.16.0 h1:s5wZFMX6/hZxONbD19pZ+JWvGaf2I7zH+f/Cem2ICAQ= +github.com/hetznercloud/hcloud-go/v2 v2.16.0/go.mod h1:h8sHav+27Xa+48cVMAvAUMELov5h298Ilg2vflyTHgg= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=