Handle nameservers as optional field in network (#521)
* make nameservers optional * fix typo in unit test * update docs * Add UseStateForUnkown --------- Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com>
This commit is contained in:
parent
aba728487f
commit
4de8552303
3 changed files with 8 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/hashicorp/terraform-plugin-framework/path"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
|
|
@ -139,7 +140,11 @@ func (r *networkResource) Schema(_ context.Context, _ resource.SchemaRequest, re
|
|||
},
|
||||
"nameservers": schema.ListAttribute{
|
||||
Description: "The nameservers of the network.",
|
||||
Required: true,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
PlanModifiers: []planmodifier.List{
|
||||
listplanmodifier.UseStateForUnknown(),
|
||||
},
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"ipv4_prefix_length": schema.Int64Attribute{
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ func TestMapFields(t *testing.T) {
|
|||
true,
|
||||
},
|
||||
{
|
||||
"nameservers_changed_outisde_tf",
|
||||
"nameservers_changed_outside_tf",
|
||||
Model{
|
||||
ProjectId: types.StringValue("pid"),
|
||||
NetworkId: types.StringValue("nid"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue