From ebadd3d73189fa0a795260ef9d0a3341f28c67f8 Mon Sep 17 00:00:00 2001 From: hkavya26 Date: Wed, 15 Dec 2021 11:06:52 +0530 Subject: [PATCH 1/2] Enhance log statements --- ibm/resource_ibm_app.go | 2 +- ibm/resource_ibm_app_domain_private.go | 2 +- ibm/resource_ibm_app_domain_shared.go | 2 +- ibm/resource_ibm_app_route.go | 2 +- ibm/resource_ibm_certificate_manager_import.go | 6 ++++-- ibm/resource_ibm_cis.go | 2 +- ibm/resource_ibm_compute_autoscale_group.go | 2 +- ibm/resource_ibm_compute_autoscale_policy.go | 2 +- ibm/resource_ibm_compute_dedicated_host.go | 2 +- ibm/resource_ibm_compute_placement_group.go | 2 +- ibm/resource_ibm_compute_provisioning_hook.go | 2 +- ibm/resource_ibm_compute_ssh_key.go | 2 +- ibm/resource_ibm_compute_ssl_certificate.go | 2 +- ibm/resource_ibm_compute_vm_instance.go | 2 +- ibm/resource_ibm_container_addons.go | 2 +- ibm/resource_ibm_container_alb_cert.go | 2 +- ibm/resource_ibm_container_cluster.go | 2 +- ibm/resource_ibm_container_storage_attachment.go | 2 +- ibm/resource_ibm_container_vpc_cluster.go | 2 +- ibm/resource_ibm_container_vpc_worker_pool.go | 2 +- ibm/resource_ibm_container_worker_pool.go | 2 +- ibm/resource_ibm_container_worker_pool_zone_attachment.go | 2 +- ibm/resource_ibm_database.go | 2 +- ibm/resource_ibm_iam_access_group_policy.go | 2 +- ibm/resource_ibm_iam_authorization_policy.go | 2 +- ibm/resource_ibm_iam_service_policy.go | 2 +- ibm/resource_ibm_iam_user_policy.go | 2 +- ibm/resource_ibm_lb.go | 2 +- ibm/resource_ibm_lb_service.go | 2 +- ibm/resource_ibm_lb_service_group.go | 2 +- ibm/resource_ibm_lb_vpx.go | 2 +- ibm/resource_ibm_lb_vpx_service.go | 2 +- ibm/resource_ibm_lb_vpx_vip.go | 2 +- ibm/resource_ibm_network_interface_sg_attachment.go | 2 +- ibm/resource_ibm_network_vlan.go | 2 +- ibm/resource_ibm_org.go | 2 +- ibm/resource_ibm_pi_key.go | 2 +- ibm/resource_ibm_pi_snapshot.go | 2 +- ibm/resource_ibm_pi_volume.go | 2 +- ibm/resource_ibm_resource_group.go | 2 +- ibm/resource_ibm_resource_instance.go | 2 +- ibm/resource_ibm_resource_key.go | 2 +- ibm/resource_ibm_securitygroup.go | 2 +- ibm/resource_ibm_service_instance.go | 2 +- ibm/resource_ibm_service_key.go | 2 +- ibm/resource_ibm_space.go | 2 +- 46 files changed, 49 insertions(+), 47 deletions(-) diff --git a/ibm/resource_ibm_app.go b/ibm/resource_ibm_app.go index f8d07ab2dad..0ef1757d90c 100644 --- a/ibm/resource_ibm_app.go +++ b/ibm/resource_ibm_app.go @@ -438,7 +438,7 @@ func resourceIBMAppExists(d *schema.ResourceData, meta interface{}) (bool, error return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting app: %s", err) } return app.Metadata.GUID == id, nil diff --git a/ibm/resource_ibm_app_domain_private.go b/ibm/resource_ibm_app_domain_private.go index fa963879a6c..385433df420 100644 --- a/ibm/resource_ibm_app_domain_private.go +++ b/ibm/resource_ibm_app_domain_private.go @@ -123,7 +123,7 @@ func resourceIBMAppDomainPrivateExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("Error getting private app domains: %s", err) } return prdomain.Metadata.GUID == prdomainGUID, nil diff --git a/ibm/resource_ibm_app_domain_shared.go b/ibm/resource_ibm_app_domain_shared.go index 0f4959264bb..862b1e13f47 100644 --- a/ibm/resource_ibm_app_domain_shared.go +++ b/ibm/resource_ibm_app_domain_shared.go @@ -124,7 +124,7 @@ func resourceIBMAppDomainSharedExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("Error getting shared domains: %s", err) } return shdomain.Metadata.GUID == shdomainGUID, nil diff --git a/ibm/resource_ibm_app_route.go b/ibm/resource_ibm_app_route.go index c77f541b143..db8c2fbcea0 100644 --- a/ibm/resource_ibm_app_route.go +++ b/ibm/resource_ibm_app_route.go @@ -184,7 +184,7 @@ func resourceIBMAppRouteExists(d *schema.ResourceData, meta interface{}) (bool, return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting app routes: %s", err) } return route.Metadata.GUID == routeGUID, nil diff --git a/ibm/resource_ibm_certificate_manager_import.go b/ibm/resource_ibm_certificate_manager_import.go index c96e9897762..53ba836618b 100644 --- a/ibm/resource_ibm_certificate_manager_import.go +++ b/ibm/resource_ibm_certificate_manager_import.go @@ -123,7 +123,9 @@ func resourceIBMCertificateManagerGet(d *schema.ResourceData, meta interface{}) } certID := d.Id() certificatedata, err := cmService.Certificate().GetCertData(certID) - + if err != nil { + return fmt.Errorf("Error getting certificate during import: %s", err) + } cminstanceid := strings.Split(certID, ":certificate:") d.Set("certificate_manager_instance_id", cminstanceid[0]+"::") d.Set("name", certificatedata.Name) @@ -221,7 +223,7 @@ func resourceIBMCertificateManagerExists(d *schema.ResourceData, meta interface{ return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error gettting certificate details in exists %s", err) } return true, nil diff --git a/ibm/resource_ibm_cis.go b/ibm/resource_ibm_cis.go index be7884ba06c..d3d7550d99f 100644 --- a/ibm/resource_ibm_cis.go +++ b/ibm/resource_ibm_cis.go @@ -435,7 +435,7 @@ func resourceIBMCISInstanceExists(d *schema.ResourceData, meta interface{}) (boo return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s %s", err, response) + return false, fmt.Errorf("[ERROR] Error getting cis instance: %s %s", err, response) } if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, cisInstanceReclamation)) { log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") diff --git a/ibm/resource_ibm_compute_autoscale_group.go b/ibm/resource_ibm_compute_autoscale_group.go index f5783dac483..1f1f411c85d 100644 --- a/ibm/resource_ibm_compute_autoscale_group.go +++ b/ibm/resource_ibm_compute_autoscale_group.go @@ -658,7 +658,7 @@ func resourceIBMComputeAutoScaleGroupExists(d *schema.ResourceData, meta interfa return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute autoscale group: %s", err) } return result.Id != nil && *result.Id == groupId, nil } diff --git a/ibm/resource_ibm_compute_autoscale_policy.go b/ibm/resource_ibm_compute_autoscale_policy.go index efb825d8083..c4e21327b36 100644 --- a/ibm/resource_ibm_compute_autoscale_policy.go +++ b/ibm/resource_ibm_compute_autoscale_policy.go @@ -358,7 +358,7 @@ func resourceIBMComputeAutoScalePolicyExists(d *schema.ResourceData, meta interf return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute autoscale policy: %s", err) } return result.Id != nil && *result.Id == policyId, nil diff --git a/ibm/resource_ibm_compute_dedicated_host.go b/ibm/resource_ibm_compute_dedicated_host.go index 94c605c6c62..d29e2958f85 100644 --- a/ibm/resource_ibm_compute_dedicated_host.go +++ b/ibm/resource_ibm_compute_dedicated_host.go @@ -289,7 +289,7 @@ func resourceIBMComputeDedicatedHostExists(d *schema.ResourceData, meta interfac return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute dedicated hosts: %s", err) } return result.Id != nil && *result.Id == dedicatedID, nil diff --git a/ibm/resource_ibm_compute_placement_group.go b/ibm/resource_ibm_compute_placement_group.go index 5397bf10a3d..8f2a9eecd08 100644 --- a/ibm/resource_ibm_compute_placement_group.go +++ b/ibm/resource_ibm_compute_placement_group.go @@ -192,7 +192,7 @@ func resourceIBMComputePlacementGroupExists(d *schema.ResourceData, meta interfa return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute placement group: %s", err) } return result.Id != nil && *result.Id == pgrpID, nil } diff --git a/ibm/resource_ibm_compute_provisioning_hook.go b/ibm/resource_ibm_compute_provisioning_hook.go index a657ae38f92..236b4394db6 100644 --- a/ibm/resource_ibm_compute_provisioning_hook.go +++ b/ibm/resource_ibm_compute_provisioning_hook.go @@ -146,7 +146,7 @@ func resourceIBMComputeProvisioningHookExists(d *schema.ResourceData, meta inter return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute provisioning hooks: %s", err) } return result.Id != nil && *result.Id == hookId, nil } diff --git a/ibm/resource_ibm_compute_ssh_key.go b/ibm/resource_ibm_compute_ssh_key.go index 3b299fbcae4..91a6556b693 100644 --- a/ibm/resource_ibm_compute_ssh_key.go +++ b/ibm/resource_ibm_compute_ssh_key.go @@ -219,7 +219,7 @@ func resourceIBMComputeSSHKeyExists(d *schema.ResourceData, meta interface{}) (b return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute ssh key: %s", err) } return result.Id != nil && *result.Id == keyID, nil } diff --git a/ibm/resource_ibm_compute_ssl_certificate.go b/ibm/resource_ibm_compute_ssl_certificate.go index c95a57eab23..f5fe11cf235 100644 --- a/ibm/resource_ibm_compute_ssl_certificate.go +++ b/ibm/resource_ibm_compute_ssl_certificate.go @@ -205,7 +205,7 @@ func resourceIBMComputeSSLCertificateExists(d *schema.ResourceData, meta interfa return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute ssl certificate: %s", err) } return cert.Id != nil && *cert.Id == id, nil } diff --git a/ibm/resource_ibm_compute_vm_instance.go b/ibm/resource_ibm_compute_vm_instance.go index 05a9adc5e35..0655064eaec 100644 --- a/ibm/resource_ibm_compute_vm_instance.go +++ b/ibm/resource_ibm_compute_vm_instance.go @@ -1878,7 +1878,7 @@ func resourceIBMComputeVmInstanceExists(d *schema.ResourceData, meta interface{} return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting compute vm instance: %s", err) } return result.Id != nil && *result.Id == guestID, nil diff --git a/ibm/resource_ibm_container_addons.go b/ibm/resource_ibm_container_addons.go index e071f481973..49bcb5113ab 100644 --- a/ibm/resource_ibm_container_addons.go +++ b/ibm/resource_ibm_container_addons.go @@ -518,7 +518,7 @@ func resourceIBMContainerAddOnsExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("[ERROR] Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting container addons: %s", err) } return true, nil diff --git a/ibm/resource_ibm_container_alb_cert.go b/ibm/resource_ibm_container_alb_cert.go index da8bcad5334..23b06881422 100644 --- a/ibm/resource_ibm_container_alb_cert.go +++ b/ibm/resource_ibm_container_alb_cert.go @@ -315,7 +315,7 @@ func resourceIBMContainerALBCertExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting ingress secret: %s", err) } return ingressSecretConfig.Cluster == clusterID && ingressSecretConfig.Name == secretName, nil diff --git a/ibm/resource_ibm_container_cluster.go b/ibm/resource_ibm_container_cluster.go index c3fa47a43d2..bc961f1689e 100644 --- a/ibm/resource_ibm_container_cluster.go +++ b/ibm/resource_ibm_container_cluster.go @@ -1672,7 +1672,7 @@ func resourceIBMContainerClusterExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting container cluster: %s", err) } return cls.ID == clusterID, nil } diff --git a/ibm/resource_ibm_container_storage_attachment.go b/ibm/resource_ibm_container_storage_attachment.go index 19f100d24a0..41a4a9de8d0 100644 --- a/ibm/resource_ibm_container_storage_attachment.go +++ b/ibm/resource_ibm_container_storage_attachment.go @@ -234,7 +234,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentExists(d *schema.ResourceData, return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", getErr) + return false, fmt.Errorf("[ERROR] Error getting storage attachement: %s", getErr) } return true, nil } diff --git a/ibm/resource_ibm_container_vpc_cluster.go b/ibm/resource_ibm_container_vpc_cluster.go index c05c3d725cd..c8b150725cb 100644 --- a/ibm/resource_ibm_container_vpc_cluster.go +++ b/ibm/resource_ibm_container_vpc_cluster.go @@ -1193,7 +1193,7 @@ func resourceIBMContainerVpcClusterExists(d *schema.ResourceData, meta interface return false, nil } } - return false, fmt.Errorf("[ERROR] Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting container vpc cluster: %s", err) } return cls.ID == clusterID, nil } diff --git a/ibm/resource_ibm_container_vpc_worker_pool.go b/ibm/resource_ibm_container_vpc_worker_pool.go index 2e34a288be0..48dbe790d11 100644 --- a/ibm/resource_ibm_container_vpc_worker_pool.go +++ b/ibm/resource_ibm_container_vpc_worker_pool.go @@ -531,7 +531,7 @@ func resourceIBMContainerVpcWorkerPoolExists(d *schema.ResourceData, meta interf return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting container vpc workerpool: %s", err) } return workerPool.ID == workerPoolID, nil diff --git a/ibm/resource_ibm_container_worker_pool.go b/ibm/resource_ibm_container_worker_pool.go index ecc4a936473..603a9a94cbd 100644 --- a/ibm/resource_ibm_container_worker_pool.go +++ b/ibm/resource_ibm_container_worker_pool.go @@ -432,7 +432,7 @@ func resourceIBMContainerWorkerPoolExists(d *schema.ResourceData, meta interface return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting container workerpool: %s", err) } return workerPool.ID == workerPoolID, nil diff --git a/ibm/resource_ibm_container_worker_pool_zone_attachment.go b/ibm/resource_ibm_container_worker_pool_zone_attachment.go index d550b1b15c0..2add915f712 100644 --- a/ibm/resource_ibm_container_worker_pool_zone_attachment.go +++ b/ibm/resource_ibm_container_worker_pool_zone_attachment.go @@ -301,7 +301,7 @@ func resourceIBMContainerWorkerPoolZoneAttachmentExists(d *schema.ResourceData, return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting container workerpool during zone attachment: %s", err) } zones := workerPool.Zones var zone v1.WorkerPoolZoneResponse diff --git a/ibm/resource_ibm_database.go b/ibm/resource_ibm_database.go index 6ee42a39589..330b3128779 100644 --- a/ibm/resource_ibm_database.go +++ b/ibm/resource_ibm_database.go @@ -1938,7 +1938,7 @@ func resourceIBMDatabaseInstanceExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("[ERROR] Error communicating with the API: %s %s", err, response) + return false, fmt.Errorf("[ERROR] Error getting database: %s %s", err, response) } if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, databaseInstanceReclamation)) { log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") diff --git a/ibm/resource_ibm_iam_access_group_policy.go b/ibm/resource_ibm_iam_access_group_policy.go index f3139d2aa86..7a05a4605e9 100644 --- a/ibm/resource_ibm_iam_access_group_policy.go +++ b/ibm/resource_ibm_iam_access_group_policy.go @@ -414,7 +414,7 @@ func resourceIBMIAMAccessGroupPolicyExists(d *schema.ResourceData, meta interfac if resp != nil && resp.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error communicating with the API: %s\n%s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting access group policy: %s\n%s", err, resp) } if accessGroupPolicy != nil && accessGroupPolicy.State != nil && *accessGroupPolicy.State == "deleted" { diff --git a/ibm/resource_ibm_iam_authorization_policy.go b/ibm/resource_ibm_iam_authorization_policy.go index 8b7f671d538..49035f5fce2 100644 --- a/ibm/resource_ibm_iam_authorization_policy.go +++ b/ibm/resource_ibm_iam_authorization_policy.go @@ -324,7 +324,7 @@ func resourceIBMIAMAuthorizationPolicyExists(d *schema.ResourceData, meta interf if resp != nil && resp.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("[ERROR] Error communicating with the API: %s\n%s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting authorisation policy: %s\n%s", err, resp) } if authorizationPolicy != nil && authorizationPolicy.State != nil && *authorizationPolicy.State == "deleted" { diff --git a/ibm/resource_ibm_iam_service_policy.go b/ibm/resource_ibm_iam_service_policy.go index 1df87a3deae..73eaeb80549 100644 --- a/ibm/resource_ibm_iam_service_policy.go +++ b/ibm/resource_ibm_iam_service_policy.go @@ -501,7 +501,7 @@ func resourceIBMIAMServicePolicyExists(d *schema.ResourceData, meta interface{}) if resp != nil && resp.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("[ERROR] Error communicating with the API: %s\n%s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting service policy: %s\n%s", err, resp) } if servicePolicy != nil && servicePolicy.State != nil && *servicePolicy.State == "deleted" { diff --git a/ibm/resource_ibm_iam_user_policy.go b/ibm/resource_ibm_iam_user_policy.go index dc9332f1cdf..64e4e763af3 100644 --- a/ibm/resource_ibm_iam_user_policy.go +++ b/ibm/resource_ibm_iam_user_policy.go @@ -448,7 +448,7 @@ func resourceIBMIAMUserPolicyExists(d *schema.ResourceData, meta interface{}) (b if resp != nil && resp.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error communicating with the API: %s\n%s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting user policy: %s\n%s", err, resp) } if userPolicy != nil && userPolicy.State != nil && *userPolicy.State == "deleted" { diff --git a/ibm/resource_ibm_lb.go b/ibm/resource_ibm_lb.go index 92ea4551a0b..45b31ff1ea4 100644 --- a/ibm/resource_ibm_lb.go +++ b/ibm/resource_ibm_lb.go @@ -391,7 +391,7 @@ func resourceIBMLbExists(d *schema.ResourceData, meta interface{}) (bool, error) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting Network Application Delivery Controller LoadBalancer Virtual IpAddress Service: %s", err) } return true, nil } diff --git a/ibm/resource_ibm_lb_service.go b/ibm/resource_ibm_lb_service.go index d8462ddbef6..100c9592006 100644 --- a/ibm/resource_ibm_lb_service.go +++ b/ibm/resource_ibm_lb_service.go @@ -317,7 +317,7 @@ func resourceIBMLbServiceExists(d *schema.ResourceData, meta interface{}) (bool, return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting lb service: %s", err) } return true, nil } diff --git a/ibm/resource_ibm_lb_service_group.go b/ibm/resource_ibm_lb_service_group.go index d72934c1eb5..ff15d4a7753 100644 --- a/ibm/resource_ibm_lb_service_group.go +++ b/ibm/resource_ibm_lb_service_group.go @@ -282,7 +282,7 @@ func resourceIBMLbServiceGroupExists(d *schema.ResourceData, meta interface{}) ( return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting lb service group: %s", err) } return true, nil diff --git a/ibm/resource_ibm_lb_vpx.go b/ibm/resource_ibm_lb_vpx.go index 264604eff72..4d783c82644 100644 --- a/ibm/resource_ibm_lb_vpx.go +++ b/ibm/resource_ibm_lb_vpx.go @@ -621,7 +621,7 @@ func resourceIBMLbVpxExists(d *schema.ResourceData, meta interface{}) (bool, err return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting lb vpx: %s", err) } return nadc.Id != nil && *nadc.Id == id, nil } diff --git a/ibm/resource_ibm_lb_vpx_service.go b/ibm/resource_ibm_lb_vpx_service.go index bf6cdcdc4d0..70d8dff37c6 100644 --- a/ibm/resource_ibm_lb_vpx_service.go +++ b/ibm/resource_ibm_lb_vpx_service.go @@ -671,7 +671,7 @@ func resourceIBMLbVpxServiceExists101(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting lb vpx service: %s", err) } return *lbService.Name == serviceName, nil } diff --git a/ibm/resource_ibm_lb_vpx_vip.go b/ibm/resource_ibm_lb_vpx_vip.go index adb6ac1d2d0..046735e4827 100644 --- a/ibm/resource_ibm_lb_vpx_vip.go +++ b/ibm/resource_ibm_lb_vpx_vip.go @@ -631,7 +631,7 @@ func resourceIBMLbVpxVipExists101(d *schema.ResourceData, meta interface{}) (boo return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting lb vip: %s", err) } return vip != nil && *vip.Name == vipName, nil } diff --git a/ibm/resource_ibm_network_interface_sg_attachment.go b/ibm/resource_ibm_network_interface_sg_attachment.go index baaea90a20a..c8dc1c1deb8 100644 --- a/ibm/resource_ibm_network_interface_sg_attachment.go +++ b/ibm/resource_ibm_network_interface_sg_attachment.go @@ -163,7 +163,7 @@ func resourceIBMNetworkInterfaceSGAttachmentExists(d *schema.ResourceData, meta return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting network component bindings: %s", err) } for _, b := range bindings { if *b.NetworkComponentId == interfaceID { diff --git a/ibm/resource_ibm_network_vlan.go b/ibm/resource_ibm_network_vlan.go index 8b0d8a8934b..f1a811a46b7 100644 --- a/ibm/resource_ibm_network_vlan.go +++ b/ibm/resource_ibm_network_vlan.go @@ -397,7 +397,7 @@ func resourceIBMNetworkVlanExists(d *schema.ResourceData, meta interface{}) (boo return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting network VLAN: %s", err) } return result.Id != nil && *result.Id == vlanID, nil } diff --git a/ibm/resource_ibm_org.go b/ibm/resource_ibm_org.go index 137efa2347b..4865f2d6cc9 100644 --- a/ibm/resource_ibm_org.go +++ b/ibm/resource_ibm_org.go @@ -220,7 +220,7 @@ func resourceIBMOrgExists(d *schema.ResourceData, meta interface{}) (bool, error return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting Organization: %s", err) } return org.Metadata.GUID == id, nil } diff --git a/ibm/resource_ibm_pi_key.go b/ibm/resource_ibm_pi_key.go index b221e646322..8ba7a46fd13 100644 --- a/ibm/resource_ibm_pi_key.go +++ b/ibm/resource_ibm_pi_key.go @@ -165,7 +165,7 @@ func resourceIBMPIKeyExists(d *schema.ResourceData, meta interface{}) (bool, err return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting pi key: %s", err) } if key.Name != nil { return *key.Name == name, nil diff --git a/ibm/resource_ibm_pi_snapshot.go b/ibm/resource_ibm_pi_snapshot.go index 8ebbfd1843e..fd0132cc208 100644 --- a/ibm/resource_ibm_pi_snapshot.go +++ b/ibm/resource_ibm_pi_snapshot.go @@ -259,7 +259,7 @@ func resourceIBMPISnapshotExists(d *schema.ResourceData, meta interface{}) (bool return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting pi snapshot: %s", err) } log.Printf("Calling the existing function.. %s", *(snapshotdelete.SnapshotID)) diff --git a/ibm/resource_ibm_pi_volume.go b/ibm/resource_ibm_pi_volume.go index 8249d7dde5a..f9485d5c593 100644 --- a/ibm/resource_ibm_pi_volume.go +++ b/ibm/resource_ibm_pi_volume.go @@ -349,7 +349,7 @@ func resourceIBMPIVolumeExists(d *schema.ResourceData, meta interface{}) (bool, return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting pi volume: %s", err) } log.Printf("Calling the existing function.. %s", *(vol.VolumeID)) diff --git a/ibm/resource_ibm_resource_group.go b/ibm/resource_ibm_resource_group.go index 78646baec29..cb84f9e20f4 100644 --- a/ibm/resource_ibm_resource_group.go +++ b/ibm/resource_ibm_resource_group.go @@ -244,7 +244,7 @@ func resourceIBMResourceGroupExists(d *schema.ResourceData, meta interface{}) (b if resp != nil && resp.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error communicating with the API: %s with response code %s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting resource group: %s with response code %s", err, resp) } return *resourceGroup.ID == resourceGroupID, nil diff --git a/ibm/resource_ibm_resource_instance.go b/ibm/resource_ibm_resource_instance.go index 1a0ec627c49..98ac3d80879 100644 --- a/ibm/resource_ibm_resource_instance.go +++ b/ibm/resource_ibm_resource_instance.go @@ -759,7 +759,7 @@ func resourceIBMResourceInstanceExists(d *schema.ResourceData, meta interface{}) if resp != nil && resp.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error communicating with the API: %s with resp code: %s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting resource instance: %s with resp code: %s", err, resp) } if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, rsInstanceReclamation)) { log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") diff --git a/ibm/resource_ibm_resource_key.go b/ibm/resource_ibm_resource_key.go index cd3147cab2f..e24a7edf568 100644 --- a/ibm/resource_ibm_resource_key.go +++ b/ibm/resource_ibm_resource_key.go @@ -390,7 +390,7 @@ func resourceIBMResourceKeyExists(d *schema.ResourceData, meta interface{}) (boo if resp != nil && (resp.StatusCode == 404 || resp.StatusCode == 410) { return false, nil } - return false, fmt.Errorf("Error communicating with the API: %s with resp code: %s", err, resp) + return false, fmt.Errorf("[ERROR] Error getting resource key: %s with resp code: %s", err, resp) } if err == nil && *resourceKey.State == "removed" { return false, nil diff --git a/ibm/resource_ibm_securitygroup.go b/ibm/resource_ibm_securitygroup.go index 32dd96506ce..83a60934f66 100644 --- a/ibm/resource_ibm_securitygroup.go +++ b/ibm/resource_ibm_securitygroup.go @@ -176,7 +176,7 @@ func resourceIBMSecurityGroupExists(d *schema.ResourceData, meta interface{}) (b return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting security group: %s", err) } return result.Id != nil && *result.Id == groupID, nil } diff --git a/ibm/resource_ibm_service_instance.go b/ibm/resource_ibm_service_instance.go index 045dd889b3e..1e5fdb521c2 100644 --- a/ibm/resource_ibm_service_instance.go +++ b/ibm/resource_ibm_service_instance.go @@ -301,7 +301,7 @@ func resourceIBMServiceInstanceExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting service instance: %s", err) } return service.Metadata.GUID == serviceGUID, nil diff --git a/ibm/resource_ibm_service_key.go b/ibm/resource_ibm_service_key.go index f4e46b2a322..1c9bdc02720 100644 --- a/ibm/resource_ibm_service_key.go +++ b/ibm/resource_ibm_service_key.go @@ -144,7 +144,7 @@ func resourceIBMServiceKeyExists(d *schema.ResourceData, meta interface{}) (bool return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting service key: %s", err) } return serviceKey.Metadata.GUID == serviceKeyGUID, nil diff --git a/ibm/resource_ibm_space.go b/ibm/resource_ibm_space.go index a21a1381ae2..ef61dc2727a 100644 --- a/ibm/resource_ibm_space.go +++ b/ibm/resource_ibm_space.go @@ -251,7 +251,7 @@ func resourceIBMSpaceExists(d *schema.ResourceData, meta interface{}) (bool, err return false, nil } } - return false, fmt.Errorf("Error communicating with the API: %s", err) + return false, fmt.Errorf("[ERROR] Error getting space: %s", err) } return space.Metadata.GUID == id, nil From a2eca66f57dad300409e6edf1f462325b832e791 Mon Sep 17 00:00:00 2001 From: hkavya26 Date: Wed, 15 Dec 2021 12:09:34 +0530 Subject: [PATCH 2/2] updated secret baseline --- .secrets.baseline | 62 +++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 9f2ae15bbb5..ac221c911c2 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2021-11-30T21:58:45Z", + "generated_at": "2021-12-15T06:20:37Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -11,9 +11,6 @@ { "name": "ArtifactoryDetector" }, - { - "name": "AzureStorageKeyDetector" - }, { "base64_limit": 4.5, "name": "Base64HighEntropyString" @@ -31,9 +28,6 @@ "ghe_instance": "github.ibm.com", "name": "GheDetector" }, - { - "name": "GitHubTokenDetector" - }, { "hex_limit": 3, "name": "HexHighEntropyString" @@ -54,9 +48,6 @@ { "name": "MailchimpDetector" }, - { - "name": "NpmDetector" - }, { "name": "PrivateKeyDetector" }, @@ -66,9 +57,6 @@ { "name": "SoftlayerDetector" }, - { - "name": "SquareOAuthDetector" - }, { "name": "StripeDetector" }, @@ -626,7 +614,7 @@ "hashed_secret": "c427f185ddcb2440be9b77c8e45f1cd487a2e790", "is_secret": false, "is_verified": false, - "line_number": 1232, + "line_number": 1258, "type": "Base64 High Entropy String", "verified_result": null }, @@ -634,7 +622,7 @@ "hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670", "is_secret": false, "is_verified": false, - "line_number": 2736, + "line_number": 2762, "type": "Secret Keyword", "verified_result": null }, @@ -642,7 +630,7 @@ "hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6", "is_secret": false, "is_verified": false, - "line_number": 2749, + "line_number": 2775, "type": "Secret Keyword", "verified_result": null }, @@ -650,7 +638,7 @@ "hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1", "is_secret": false, "is_verified": false, - "line_number": 2787, + "line_number": 2816, "type": "Secret Keyword", "verified_result": null } @@ -846,7 +834,7 @@ "hashed_secret": "884a58e4c2c5d195d3876787bdc63af6c5af2924", "is_secret": false, "is_verified": false, - "line_number": 340, + "line_number": 344, "type": "Secret Keyword", "verified_result": null } @@ -966,7 +954,7 @@ "hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9", "is_secret": false, "is_verified": false, - "line_number": 1033, + "line_number": 1051, "type": "Secret Keyword", "verified_result": null }, @@ -974,7 +962,7 @@ "hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437", "is_secret": false, "is_verified": false, - "line_number": 1039, + "line_number": 1057, "type": "Secret Keyword", "verified_result": null } @@ -984,7 +972,7 @@ "hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6", "is_secret": false, "is_verified": false, - "line_number": 593, + "line_number": 603, "type": "Base64 High Entropy String", "verified_result": null } @@ -1323,6 +1311,16 @@ "verified_result": null } ], + "ibm/resource_ibm_container_alb_cert.go": [ + { + "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", + "is_secret": false, + "is_verified": false, + "line_number": 318, + "type": "Secret Keyword", + "verified_result": null + } + ], "ibm/resource_ibm_container_cluster.go": [ { "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", @@ -1338,7 +1336,7 @@ "hashed_secret": "884a58e4c2c5d195d3876787bdc63af6c5af2924", "is_secret": false, "is_verified": false, - "line_number": 1306, + "line_number": 1303, "type": "Secret Keyword", "verified_result": null } @@ -1358,7 +1356,7 @@ "hashed_secret": "988ff3bd9a74260f3e32e115fdd6535aaa5c531a", "is_secret": false, "is_verified": false, - "line_number": 694, + "line_number": 695, "type": "Secret Keyword", "verified_result": null } @@ -1368,7 +1366,7 @@ "hashed_secret": "7deb7557ec8b36e7d5958afe3e08959e7f1ba813", "is_secret": false, "is_verified": false, - "line_number": 1164, + "line_number": 1165, "type": "Secret Keyword", "verified_result": null }, @@ -1376,7 +1374,7 @@ "hashed_secret": "b62aab00e3bf482bfb75e3e42fd5d1be72f33ec0", "is_secret": false, "is_verified": false, - "line_number": 1259, + "line_number": 1260, "type": "Secret Keyword", "verified_result": null }, @@ -1384,7 +1382,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 1744, + "line_number": 1745, "type": "Secret Keyword", "verified_result": null }, @@ -1392,7 +1390,7 @@ "hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c", "is_secret": false, "is_verified": false, - "line_number": 1861, + "line_number": 1862, "type": "Secret Keyword", "verified_result": null } @@ -1502,7 +1500,7 @@ "hashed_secret": "b02fa7fd7ca08b5dc86c2548e40f8a21171ef977", "is_secret": false, "is_verified": false, - "line_number": 233, + "line_number": 257, "type": "Secret Keyword", "verified_result": null }, @@ -1510,7 +1508,7 @@ "hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030", "is_secret": false, "is_verified": false, - "line_number": 270, + "line_number": 294, "type": "Secret Keyword", "verified_result": null } @@ -1790,7 +1788,7 @@ "hashed_secret": "da8cae6284528565678de15e03d461e23fe22538", "is_secret": false, "is_verified": false, - "line_number": 1464, + "line_number": 1465, "type": "Secret Keyword", "verified_result": null } @@ -2102,7 +2100,7 @@ "hashed_secret": "19463ab0c6cf2c8f229c8c9666f2f784edf6bb4f", "is_secret": false, "is_verified": false, - "line_number": 159, + "line_number": 160, "type": "Secret Keyword", "verified_result": null } @@ -2138,7 +2136,7 @@ } ] }, - "version": "0.13.1+ibm.46.dss", + "version": "0.13.1+ibm.40.dss", "word_list": { "file": null, "hash": null