Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnssvcs module was broken after SDK release. #4667

Merged
merged 10 commits into from
Jul 5, 2023

Conversation

gahlaut-rahul
Copy link
Contributor

@gahlaut-rahul gahlaut-rahul commented Jul 4, 2023

Community Note

  • Please vote on this pull request by adding a 馃憤 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'


...

Test result : Pass

Root Cause

It was because of change in DS in dns SDK.

Copy link
Contributor

@arpit-srivastava-ibm arpit-srivastava-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks perfectly fine

@hkantare
Copy link
Collaborator

hkantare commented Jul 4, 2023

Can you add test results after this change

@gahlaut-rahul
Copy link
Contributor Author

gahlaut-rahul commented Jul 4, 2023

@hkantare Nothing is changed w.r.t. functionality, build was breaking and it is fixed and tested locally.

Before fix

rahul.gahlautibm.com@Rahuls-MacBook-Pro terraform-provider-ibm % make testacc TEST=./ibm/service/dnsservices
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./ibm/service/dnsservices -v -timeout 700m
# [github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices](http://github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices)
ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go:351:12: invalid operation: cannot indirect response.Rdata.(map[string]interface{}) (comma, ok expression of type map[string]interface{})
ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go:361:12: invalid operation: cannot indirect response.Rdata.(map[string]interface{}) (comma, ok expression of type map[string]interface{})
ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go:366:12: invalid operation: cannot indirect response.Rdata.(map[string]interface{}) (comma, ok expression of type map[string]interface{})
ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go:370:12: invalid operation: cannot indirect response.Rdata.(map[string]interface{}) (comma, ok expression of type map[string]interface{})
ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go:374:12: invalid operation: cannot indirect response.Rdata.(map[string]interface{}) (comma, ok expression of type map[string]interface{})
ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go:378:12: invalid operation: cannot indirect response.Rdata.(map[string]interface{}) (comma, ok expression of type map[string]interface{})

Below are the logs (After fix)

rahul.gahlautibm.com@Rahuls-MacBook-Pro terraform-provider-ibm % make testacc TEST=./ibm/service/dnsservices 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./ibm/service/dnsservices -v  -timeout 700m
[WARN] Set the environment variable IBM_APPID_TENANT_ID for testing AppID resources, AppID tests will fail if this is not set


[INFO] Set the environment variable SL_REGION for testing ibm_is_region datasource else it is set to default value 'us-south'
[INFO] Set the environment variable SL_ZONE for testing ibm_is_zone datasource else it is set to default value 'us-south-1'
[INFO] Set the environment variable SL_ZONE_2 for testing ibm_is_zone datasource else it is set to default value 'us-south-2'

[INFO] Set the environment variable IS_WIN_IMAGE for testing ibm_is_instance data source else it is set to default value 'r006-d2e0d0e9-0a4f-4c45-afd7-cab787030776'
'instance-01'
[INFO] Set the environment variable IS_BACKUP_POLICY_JOB_ID for testing ibm_is_backup_policy_job datasource
[INFO] Set the environment variable IS_BACKUP_POLICY_ID for testing ibm_is_backup_policy_jobs datasource

[INFO] Set the environment variable IS_SHARE_PROFILE for testing ibm_is_instance resource else it is set to default value 'tier-3iops'
'r006-1cbe9f0a-7101-4d25-ae72-2a2d725e530e'
...
[WARN] Set the environment variable IBM_CODE_ENGINE_RESOURCE_KEY_ID with the ID of a resource key to access a service instance
=== RUN   TestAccIBMPrivateDNSCustomResolverForwardingRulesDataSource_basic
--- PASS: TestAccIBMPrivateDNSCustomResolverForwardingRulesDataSource_basic (257.42s)
=== RUN   TestAccIBMPrivateDNSCustomResolverDataSource_basic
--- PASS: TestAccIBMPrivateDNSCustomResolverDataSource_basic (175.98s)
=== RUN   TestAccIBMPrivateDNSGlbMonitorsDataSource_basic

rahul.gahlautibm.com@Rahuls-MacBook-Pro terraform-provider-ibm % date
Tue Jul  4 19:49:10 IST 2023
rahul.gahlautibm.com@Rahuls-MacBook-Pro terraform-provider-ibm % 

@gahlaut-rahul
Copy link
Contributor Author

@hkantare

Do not merge it, we've explored one more issue which is impacting few UTs.

@@ -348,7 +348,7 @@ func resourceIBMPrivateDNSResourceRecordRead(d *schema.ResourceData, meta interf
d.Set(pdnsRecordModifiedOn, response.ModifiedOn)

if *response.Type == "SRV" {
data := response.Rdata.(map[string]interface{})
data := response.Rdata
d.Set(pdnsSrvPort, data["port"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you abel to access data["port"] on interface type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, There is no problem but i am fixing some other issue.

@hkantare hkantare merged commit 88c131f into IBM-Cloud:master Jul 5, 2023
2 checks passed
@gahlaut-rahul gahlaut-rahul deleted the pdns_fix_travis branch July 5, 2023 10:10
omaraibrahim pushed a commit to omaraibrahim/terraform-provider-ibm that referenced this pull request Jul 20, 2023
* Enabled argument updated in docs for PDNS glb resource

* reverting the change made to main branch wrongly

* Updated the terraform code to make it work with lastest sdk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants