🐙 fix server import for public_ipv4_count (#43)

This commit is contained in:
Oscar Hermoso
2024-11-13 22:22:10 +08:00
committed by GitHub
parent 2a6ba27340
commit 2bc281d177
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -479,6 +479,7 @@ func (r *serverResource) Read(ctx context.Context, req resource.ReadRequest, res
privateIpv4Addresses = append(privateIpv4Addresses, v4address.IpAddress)
}
}
data.PublicIpv4Count = types.Int32Value(int32(len(publicIpv4Addresses)))
data.PublicIpv4Addresses, diags = types.ListValueFrom(ctx, types.StringType, publicIpv4Addresses)
resp.Diagnostics.Append(diags...)
data.PrivateIPv4Addresses, diags = types.ListValueFrom(ctx, types.StringType, privateIpv4Addresses)
+2 -2
View File
@@ -104,7 +104,7 @@ echo "Hello World" > /var/tmp/output.txt
ResourceName: "binarylane_server.test",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"password", "ssh_keys", "user_data", "public_ipv4_count", "timeouts"},
ImportStateVerifyIgnore: []string{"password", "ssh_keys", "user_data", "timeouts"},
},
// Test import by name
{
@@ -112,7 +112,7 @@ echo "Hello World" > /var/tmp/output.txt
ImportState: true,
ImportStateId: "tf-test-server-resource",
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"password", "ssh_keys", "user_data", "public_ipv4_count", "timeouts"},
ImportStateVerifyIgnore: []string{"password", "ssh_keys", "user_data", "timeouts"},
},
// Update and Read testing
{