mirror of
https://github.com/oscarhermoso/terraform-provider-binarylane
synced 2026-10-18 13:38:08 +11:00
🐙 fix server import for public_ipv4_count (#43)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user