Add UseStateForUnknown for all Computed fields that RequireReplacement and dont change after an update (#149)
This commit is contained in:
parent
f62984aa0f
commit
45e8981350
3 changed files with 10 additions and 0 deletions
|
|
@ -231,6 +231,7 @@ func (r *zoneResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
|
||||||
ElementType: types.StringType,
|
ElementType: types.StringType,
|
||||||
PlanModifiers: []planmodifier.List{
|
PlanModifiers: []planmodifier.List{
|
||||||
listplanmodifier.RequiresReplace(),
|
listplanmodifier.RequiresReplace(),
|
||||||
|
listplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
Validators: []validator.List{
|
Validators: []validator.List{
|
||||||
listvalidator.SizeAtMost(10),
|
listvalidator.SizeAtMost(10),
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.String{
|
PlanModifiers: []planmodifier.String{
|
||||||
stringplanmodifier.RequiresReplace(),
|
stringplanmodifier.RequiresReplace(),
|
||||||
|
stringplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"port": schema.Int64Attribute{
|
"port": schema.Int64Attribute{
|
||||||
|
|
@ -279,6 +280,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.Int64{
|
PlanModifiers: []planmodifier.Int64{
|
||||||
int64planmodifier.RequiresReplace(),
|
int64planmodifier.RequiresReplace(),
|
||||||
|
int64planmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"protocol": schema.StringAttribute{
|
"protocol": schema.StringAttribute{
|
||||||
|
|
@ -287,6 +289,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.String{
|
PlanModifiers: []planmodifier.String{
|
||||||
stringplanmodifier.RequiresReplace(),
|
stringplanmodifier.RequiresReplace(),
|
||||||
|
stringplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
Validators: []validator.String{
|
Validators: []validator.String{
|
||||||
stringvalidator.OneOf("PROTOCOL_UNSPECIFIED", "PROTOCOL_TCP", "PROTOCOL_UDP", "PROTOCOL_TCP_PROXY"),
|
stringvalidator.OneOf("PROTOCOL_UNSPECIFIED", "PROTOCOL_TCP", "PROTOCOL_UDP", "PROTOCOL_TCP_PROXY"),
|
||||||
|
|
@ -298,6 +301,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.String{
|
PlanModifiers: []planmodifier.String{
|
||||||
stringplanmodifier.RequiresReplace(),
|
stringplanmodifier.RequiresReplace(),
|
||||||
|
stringplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -343,6 +347,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.String{
|
PlanModifiers: []planmodifier.String{
|
||||||
stringplanmodifier.RequiresReplace(),
|
stringplanmodifier.RequiresReplace(),
|
||||||
|
stringplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
Validators: []validator.String{
|
Validators: []validator.String{
|
||||||
stringvalidator.OneOf("ROLE_UNSPECIFIED", "ROLE_LISTENERS_AND_TARGETS", "ROLE_LISTENERS", "ROLE_TARGETS"),
|
stringvalidator.OneOf("ROLE_UNSPECIFIED", "ROLE_LISTENERS_AND_TARGETS", "ROLE_LISTENERS", "ROLE_TARGETS"),
|
||||||
|
|
@ -357,6 +362,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.Object{
|
PlanModifiers: []planmodifier.Object{
|
||||||
objectplanmodifier.RequiresReplace(),
|
objectplanmodifier.RequiresReplace(),
|
||||||
|
objectplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
Attributes: map[string]schema.Attribute{
|
Attributes: map[string]schema.Attribute{
|
||||||
"acl": schema.SetAttribute{
|
"acl": schema.SetAttribute{
|
||||||
|
|
@ -366,6 +372,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.Set{
|
PlanModifiers: []planmodifier.Set{
|
||||||
setplanmodifier.RequiresReplace(),
|
setplanmodifier.RequiresReplace(),
|
||||||
|
setplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
Validators: []validator.Set{
|
Validators: []validator.Set{
|
||||||
setvalidator.ValueStringsAre(
|
setvalidator.ValueStringsAre(
|
||||||
|
|
@ -379,6 +386,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.Bool{
|
PlanModifiers: []planmodifier.Bool{
|
||||||
boolplanmodifier.RequiresReplace(),
|
boolplanmodifier.RequiresReplace(),
|
||||||
|
boolplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,7 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
|
||||||
Computed: true,
|
Computed: true,
|
||||||
PlanModifiers: []planmodifier.String{
|
PlanModifiers: []planmodifier.String{
|
||||||
stringplanmodifier.RequiresReplace(),
|
stringplanmodifier.RequiresReplace(),
|
||||||
|
stringplanmodifier.UseStateForUnknown(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"roles": schema.SetAttribute{
|
"roles": schema.SetAttribute{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue