Skip to content

Commit 8422d22

Browse files
committed
novalidate
1 parent fcf226b commit 8422d22

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

internal/fleet/agent_policy/schema.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ package agent_policy
33
import (
44
"context"
55

6-
"github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator"
76
"github.com/hashicorp/terraform-plugin-framework/attr"
8-
"github.com/hashicorp/terraform-plugin-framework/path"
97
"github.com/hashicorp/terraform-plugin-framework/resource"
108
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
119
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1210
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
1311
"github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier"
1412
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1513
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
16-
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
1714
)
1815

1916
func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
@@ -98,15 +95,21 @@ func getSchema() schema.Schema {
9895
"string_value": schema.StringAttribute{
9996
Description: "String value for the field. If this is set, number_value must not be defined.",
10097
Optional: true,
98+
// Validators: []validator.String{
99+
// stringvalidator.ExactlyOneOf(path.MatchRelative()),
100+
// },
101101
},
102102
"number_value": schema.Float32Attribute{
103103
Description: "Number value for the field. If this is set, string_value must not be defined.",
104104
Optional: true,
105+
// Validators: []validator.Float32{
106+
// float32validator.ExactlyOneOf(path.MatchRelative()),
107+
// },
105108
},
106109
},
107-
Validators: []validator.Object{
108-
objectvalidator.ExactlyOneOf(path.MatchRoot("string_value"), path.MatchRoot("number_value")),
109-
},
110+
// Validators: []validator.Object{
111+
// objectvalidator.ExactlyOneOf(path.MatchRelative().AtAnyMapKey())
112+
// },
110113
},
111114
Optional: true,
112115
PlanModifiers: []planmodifier.Map{

0 commit comments

Comments
 (0)