diff --git a/powerscale/provider/synciq_replication_reports_datasource.go b/powerscale/provider/synciq_replication_reports_datasource.go index ad8f60e..dae4431 100644 --- a/powerscale/provider/synciq_replication_reports_datasource.go +++ b/powerscale/provider/synciq_replication_reports_datasource.go @@ -854,6 +854,11 @@ func (d *ReplicationReportDataSource) Read(ctx context.Context, req datasource.R ) return } + + if len(*replicationReportList) == 0 { + resp.Diagnostics.AddError("Error reading replication reports", "No replication report found") + } + var rr []models.ReplicationReportsDetail for _, rrItem := range *replicationReportList { entity := models.ReplicationReportsDetail{} @@ -865,6 +870,7 @@ func (d *ReplicationReportDataSource) Read(ctx context.Context, req datasource.R } rr = append(rr, entity) } + state.Reports = rr state.ID = types.StringValue("synciq_replication_report_datasource") // Save data into Terraform state