Skip to content

Commit 2eaedbe

Browse files
authored
tf query: add identity version for the list_resource_found message (#176)
1 parent 2fd2922 commit 2eaedbe

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

logging_query.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ type ListResourceFoundMessage struct {
2929
}
3030

3131
type ListResourceFoundData struct {
32-
Address string `json:"address"`
33-
DisplayName string `json:"display_name"`
34-
Identity map[string]json.RawMessage `json:"identity"`
35-
ResourceType string `json:"resource_type"`
36-
ResourceObject map[string]json.RawMessage `json:"resource_object,omitempty"`
37-
Config string `json:"config,omitempty"`
38-
ImportConfig string `json:"import_config,omitempty"`
32+
Address string `json:"address"`
33+
DisplayName string `json:"display_name"`
34+
Identity map[string]json.RawMessage `json:"identity"`
35+
IdentityVersion int64 `json:"identity_version"`
36+
ResourceType string `json:"resource_type"`
37+
ResourceObject map[string]json.RawMessage `json:"resource_object,omitempty"`
38+
Config string `json:"config,omitempty"`
39+
ImportConfig string `json:"import_config,omitempty"`
3940
}
4041

4142
// ListCompleteMessage represents "query" result message of type "list_complete"

logging_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func TestLogging_query(t *testing.T) {
120120
},
121121
},
122122
{
123-
`{"@level":"info","@message":"list.concept_pet.pets: Result found","@module":"terraform.ui","@timestamp":"2025-08-28T18:07:11.534589+00:00","list_resource_found":{"address":"list.concept_pet.pets","display_name":"This is a easy-antelope","identity":{"id":"easy-antelope","legs":6},"resource_type":"concept_pet"},"type":"list_resource_found"}`,
123+
`{"@level":"info","@message":"list.concept_pet.pets: Result found","@module":"terraform.ui","@timestamp":"2025-08-28T18:07:11.534589+00:00","list_resource_found":{"address":"list.concept_pet.pets","display_name":"This is a easy-antelope","identity":{"id":"easy-antelope","legs":6},"identity_version":1,"resource_type":"concept_pet"},"type":"list_resource_found"}`,
124124
ListResourceFoundMessage{
125125
baseLogMessage: baseLogMessage{
126126
Lvl: Info,
@@ -135,6 +135,7 @@ func TestLogging_query(t *testing.T) {
135135
"id": json.RawMessage(`"easy-antelope"`),
136136
"legs": json.RawMessage("6"),
137137
},
138+
IdentityVersion: 1,
138139
},
139140
},
140141
},

0 commit comments

Comments
 (0)