Skip to content

Commit fea179c

Browse files
Replace custom JSON hook with is_document for DashboardBody (#67)
## Summary Replaces the custom delta_pre_compare hook and hand-written JSON comparison code with the standard is_document: true generator annotation for Dashboard.DashboardBody. ## Problem The DashboardBody field accepts a JSON document. Previously this was handled by a custom delta_pre_compare hook with a compareDashboardBody function that performed JSON unmarshal + reflect.DeepEqual. This worked but duplicated functionality that the runtime already provides via the is_document annotation. ## Changes - Added is_document: true to Dashboard.DashboardBody in generator.yaml - Removed compare.is_ignored: true (no longer needed since the annotation handles comparison) - Removed templates/hooks/dashboard/delta_pre_compare.go.tpl - Removed pkg/resource/dashboard/hooks.go (custom compareDashboardBody and compareJSONObjects functions) - Regenerated controller code — delta.go now uses the runtime's DocumentEqual function ## Testing - go build ./cmd/controller — compiles cleanly - Existing e2e test (dashboard.yaml fixture) already exercises dashboardBody with JSON content - Behavior is unchanged: both approaches perform semantic JSON comparison By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 7088c4b commit fea179c

6 files changed

Lines changed: 9 additions & 51 deletions

File tree

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2026-05-19T18:44:39Z"
3-
build_hash: e581e886276bd781409a3fb11fa665ea31de17d4
4-
go_version: go1.26.3
5-
version: v0.59.1
2+
build_date: "2026-06-19T03:38:09Z"
3+
build_hash: 2970ca9b3789515150e27ab80630175a8c77cba4
4+
go_version: go1.26.0
5+
version: v0.59.1-7-g2970ca9
66
api_directory_checksum: 875e21de9852e490d33fd9e0e28e54153a267f81
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 47fa5817a145eb10af67b5411707f83179c04035
10+
file_checksum: f48b7ef48b1083851cd351747e6e31888a040dcc
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,12 @@ resources:
6464
is_primary_key: true
6565
is_required: true
6666
DashboardBody:
67-
compare:
68-
is_ignored: true
67+
is_document: true
6968
is_required: true
7069
DashboardArn:
7170
is_read_only: true
7271

7372
hooks:
74-
delta_pre_compare:
75-
template_path: hooks/dashboard/delta_pre_compare.go.tpl
7673
sdk_delete_post_build_request:
7774
template_path: hooks/dashboard/sdk_delete_post_build_request.go.tpl
7875
exceptions:

generator.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,12 @@ resources:
6464
is_primary_key: true
6565
is_required: true
6666
DashboardBody:
67-
compare:
68-
is_ignored: true
67+
is_document: true
6968
is_required: true
7069
DashboardArn:
7170
is_read_only: true
7271

7372
hooks:
74-
delta_pre_compare:
75-
template_path: hooks/dashboard/delta_pre_compare.go.tpl
7673
sdk_delete_post_build_request:
7774
template_path: hooks/dashboard/sdk_delete_post_build_request.go.tpl
7875
exceptions:

pkg/resource/dashboard/delta.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/dashboard/hooks.go

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

templates/hooks/dashboard/delta_pre_compare.go.tpl

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

0 commit comments

Comments
 (0)