From dd1e92a3c6c559dba91829339570b9c5bbe2bf23 Mon Sep 17 00:00:00 2001 From: Niharika <35183015+niharika-98@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:21:52 +0530 Subject: [PATCH] Added comments as per review comment 1) Added inline comment 2) Edited error string --- .../backupdr/data_source_backup_dr_management_server.go.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mmv1/third_party/terraform/services/backupdr/data_source_backup_dr_management_server.go.erb b/mmv1/third_party/terraform/services/backupdr/data_source_backup_dr_management_server.go.erb index e560e34ec460..69cc9f435c5e 100644 --- a/mmv1/third_party/terraform/services/backupdr/data_source_backup_dr_management_server.go.erb +++ b/mmv1/third_party/terraform/services/backupdr/data_source_backup_dr_management_server.go.erb @@ -31,6 +31,7 @@ func flattenBackupDRManagementServerResourceResp(v interface{}, d *schema.Resour fmt.Printf("Interface is : %s", v) l := v.([]interface{}) for _, raw := range l { + // Management server is a singleton resource. It is only present in one location per project. Hence returning first resource present. return flattenBackupDRManagementServerResource(raw, d, config) } return nil @@ -75,7 +76,7 @@ func dataSourceGoogleCloudBackupDRServiceRead(d *schema.ResourceData, meta inter UserAgent: userAgent, }) if err != nil { - return fmt.Errorf("Error constructing id: %s", err) + return fmt.Errorf("Error reading ManagementServer: %s", err) } resourceResponse := flattenBackupDRManagementServerResourceResp(res["managementServers"], d, config) if err := d.Set("project", project); err != nil { @@ -101,4 +102,4 @@ func dataSourceGoogleCloudBackupDRServiceRead(d *schema.ResourceData, meta inter d.Set("name", name) return nil } -<% end -%> \ No newline at end of file +<% end -%>