Skip to content

Commit 6f7405d

Browse files
remove custom validators
1 parent 83f0874 commit 6f7405d

File tree

3 files changed

+3
-176
lines changed

3 files changed

+3
-176
lines changed

internal/helper/validation/position_coordinates.go

Lines changed: 0 additions & 68 deletions
This file was deleted.

internal/helper/validation/position_coordinates_test.go

Lines changed: 0 additions & 101 deletions
This file was deleted.

internal/provider/flexible_board_resource.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121

2222
"github.com/honeycombio/terraform-provider-honeycombio/client"
2323
"github.com/honeycombio/terraform-provider-honeycombio/internal/helper"
24-
"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/validation"
2524
"github.com/honeycombio/terraform-provider-honeycombio/internal/models"
2625
)
2726

@@ -101,9 +100,6 @@ func (*flexibleBoardResource) Schema(_ context.Context, _ resource.SchemaRequest
101100
Blocks: map[string]schema.Block{
102101
"panel": schema.ListNestedBlock{
103102
Description: "List of panels to render on the board.",
104-
Validators: []validator.List{
105-
validation.RequireConsistentPanelPositions(),
106-
},
107103
NestedObject: schema.NestedBlockObject{
108104
Attributes: map[string]schema.Attribute{
109105
"type": schema.StringAttribute{
@@ -125,6 +121,7 @@ func (*flexibleBoardResource) Schema(_ context.Context, _ resource.SchemaRequest
125121
Description: "The X coordinate of the panel.",
126122
Validators: []validator.Int64{
127123
int64validator.AtLeast(0),
124+
int64validator.AlsoRequires(path.MatchRelative().AtParent().AtName("y_coordinate")),
128125
},
129126
},
130127
"y_coordinate": schema.Int64Attribute{
@@ -134,6 +131,7 @@ func (*flexibleBoardResource) Schema(_ context.Context, _ resource.SchemaRequest
134131
Description: "The Y coordinate of the panel.",
135132
Validators: []validator.Int64{
136133
int64validator.AtLeast(0),
134+
int64validator.AlsoRequires(path.MatchRelative().AtParent().AtName("x_coordinate")),
137135
},
138136
},
139137
"height": schema.Int64Attribute{
@@ -152,12 +150,10 @@ func (*flexibleBoardResource) Schema(_ context.Context, _ resource.SchemaRequest
152150
Description: "The width of the panel.",
153151
Validators: []validator.Int64{
154152
int64validator.AtLeast(1),
153+
int64validator.AtMost(12),
155154
},
156155
},
157156
},
158-
Validators: []validator.Object{
159-
validation.RequireBothCoordinates(),
160-
},
161157
},
162158
"slo_panel": schema.ListNestedBlock{
163159
Description: "A Service Level Objective(SLO) panel to be displayed on the Board.",

0 commit comments

Comments
 (0)