From 4af57a06737c266cad280366938bc2e094f2c6ca Mon Sep 17 00:00:00 2001 From: Luiggi33 Date: Mon, 19 Aug 2024 13:25:17 +0200 Subject: [PATCH] fix up types --- go.mod | 2 +- go.sum | 6 ++---- internal/provider/node_resource.go | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index bc228c6..f6d63f0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module terraform-provider-pterodactyl go 1.21 require ( - github.com/Luiggi33/pterodactyl-client-go v0.1.1 + github.com/Luiggi33/pterodactyl-client-go v0.2.0 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-framework v1.11.0 github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 diff --git a/go.sum b/go.sum index 8189187..e6c630b 100644 --- a/go.sum +++ b/go.sum @@ -4,10 +4,8 @@ github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0= github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc= -github.com/Luiggi33/pterodactyl-client-go v0.1.0 h1:NBB2hz9ZfQFFTUJGHxh7BfwXk8iNi+l7iVC0yT6/18M= -github.com/Luiggi33/pterodactyl-client-go v0.1.0/go.mod h1:lGesDuNHKaPCdArSZw3t3OIkVyIaj0H5nYEONXBJXVk= -github.com/Luiggi33/pterodactyl-client-go v0.1.1 h1:IKcehIBPUA4LqLTyblNhWvOzuG6SHusvHhitphWk7uc= -github.com/Luiggi33/pterodactyl-client-go v0.1.1/go.mod h1:lGesDuNHKaPCdArSZw3t3OIkVyIaj0H5nYEONXBJXVk= +github.com/Luiggi33/pterodactyl-client-go v0.2.0 h1:+useQNmmPAsvE4x6lgtqfEQubHAYXC+N5BZUT8KE9fs= +github.com/Luiggi33/pterodactyl-client-go v0.2.0/go.mod h1:lGesDuNHKaPCdArSZw3t3OIkVyIaj0H5nYEONXBJXVk= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= diff --git a/internal/provider/node_resource.go b/internal/provider/node_resource.go index 5ced065..b9118a2 100644 --- a/internal/provider/node_resource.go +++ b/internal/provider/node_resource.go @@ -237,7 +237,7 @@ func (r *nodeResource) Create(ctx context.Context, req resource.CreateRequest, r // Create partial allocation partialAllocation := pterodactyl.PartialAllocation{ IP: allocation.IP.ValueString(), - Ports: []int32{allocation.Port.ValueInt32()}, + Ports: []string{strconv.Itoa(int(allocation.Port.ValueInt32()))}, } // Create new allocation @@ -445,7 +445,7 @@ func (r *nodeResource) Update(ctx context.Context, req resource.UpdateRequest, r if allocation.ID.IsNull() { partialAllocation := pterodactyl.PartialAllocation{ IP: allocation.IP.ValueString(), - Ports: []int32{allocation.Port.ValueInt32()}, + Ports: []string{strconv.Itoa(int(allocation.Port.ValueInt32()))}, } // Create new allocation err := r.client.CreateAllocation(plan.ID.ValueInt32(), partialAllocation)