Skip to content

Commit 8c0f071

Browse files
committed
fix post-test destroy in acc test
1 parent 91caae9 commit 8c0f071

File tree

1 file changed

+6
-2
lines changed
  • internal/elasticsearch/index/data_stream_lifecycle

1 file changed

+6
-2
lines changed

internal/elasticsearch/index/data_stream_lifecycle/acc_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,16 @@ func checkResourceDataStreamLifecycleDestroy(s *terraform.State) error {
273273

274274
defer res.Body.Close()
275275

276-
dStreams := make(map[string][]models.DataStreamLifecycle)
276+
dStreams := struct {
277+
DataStreams []models.DataStreamLifecycle `json:"data_streams,omitempty"`
278+
}{}
279+
277280
if err := json.NewDecoder(res.Body).Decode(&dStreams); err != nil {
278281
return err
279282
}
283+
280284
// for lifecycle with wildcard empty array is returned
281-
if len(dStreams["data_streams"]) > 0 {
285+
if len(dStreams.DataStreams) > 0 {
282286
return fmt.Errorf("Data Stream Lifecycle (%s) still exists", compId.ResourceId)
283287
}
284288
}

0 commit comments

Comments
 (0)