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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with x-terraform-ignore-order #346

Open
2 tasks
arjunrajinstaclustr opened this issue May 26, 2022 · 0 comments · May be fixed by #347
Open
2 tasks

Issues with x-terraform-ignore-order #346

arjunrajinstaclustr opened this issue May 26, 2022 · 0 comments · May be fixed by #347

Comments

@arjunrajinstaclustr
Copy link

Describe the bug

After using the terraform-provider-openapi plugin fairly extensively, several issues have been identified with the behaviour of the plugin when using with the x-terraform-ignore-order flag -

  1. The plugin throws an NPE when the API response does not contain an optional property.
  2. The plugin does not correctly deal with camelCase vs terraform_compliant_name on property names.
  3. The plugin doesn't correctly handle cases where Terraform sets default values even for optional properties but the API does not return the optional property. (Example - in the local state, arrays become [], maps become {}, strings become "", integers become 0, booleans become false)
  4. The plugin does not correctly deal with integers returned from the API when comparing against the local state, because the API response is mapped to a float64 value but the local state is an integer.

To Reproduce

A clear and concise description on how does it work now and what's the current behaviour.

Steps to reproduce the behavior:

  1. Update TestAccCDN_CreateResourceWithIgnoreListOrderExtension with the following - https://github.com/instaclustr/terraform-provider-openapi/blob/b287aa636768f0b7d2fc4a30b14deb528165225a/tests/e2e/gray_box_cdns_test.go#L429-L663
  2. Run the test

Expected behaviour

The test passes, and the x-terraform-ignore-order flag correctly handles all of the aforementioned issues.

Additional context

Add any other context about the problem here.

Checklist (for admin only)

Don't forget to go through the checklist to make sure the issue is created properly:

  • I have added a corresponding label (bug) to the issue (right side menu)
  • I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
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 a pull request may close this issue.

1 participant