-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
v0.12 testing: A mysterious extra entry #20486
Comments
Hi @jtopjian, Thanks, I've managed to reproduce this issue. It looks like it's a Strangely enough, the |
Hi @jbardin I am currently working on upgrading the fastly terraform provider to work with Terraform 0.12 and I have noticed that terraform, (version 0.12.1) has been returning extra entries as described in this issue. When I removed the two StateFunc entries from the schema then I get the expected output, but as in this case the required functions then would not be executed to generate a checksum to be stored in the terraform.state file.
In the example above using the StateFunc enabled provider creates two entries. The first a fully populated map with the required checksum for the fields "s3_access_key" and "s3_secret_key". The second entry contains blank values for all fields except the two previously mentioned and they are stored with the original value before being processed by the functions. I would expect a single entry with the original non checksum values and the terraform.state file to hold the checksum values. Any thoughts about how to proceed? |
Hi @trentrosenbaum, I don't think I've encountered use of the I'm also not sure I understand the use of the |
Hi @jbardin Thanks for coming back to me it is really appreciated. I have a bit of a limited history with the provider and I am going to try and find out more about the use of the StateFunc in this case. It is my understanding that the StateFunc is used to store a value in the terraform.state file while the original values are then communicated to the appropriate API. In the same provider there is the an example where a set of vcl entries use the StateFunc to hash a code snippet. I think this is the more intended use of the function? Again this is a set and fails for the same reason. This is the example configuration I am using to test the s3logging nest block in the service.
|
Thanks for the config @trentrosenbaum. |
Hi @jbardin This one is using the 0.12.0 SDK and not 0.12.1 SDK, (which I just realized) and I was using the 0.12.1 terraform cli. I did have the same issue with 0.12.0 SDK and 0.12.0 terraform cli. |
Got it, I was looking at the final output, but the extra elements show up in the provider itself. |
Unfortunately the issue was what I thought, which doesn't leave us with a good solution. I opened #21641 to help any other providers that may have used this pattern diagnose the issue. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Tests for the
openstack_compute_secgroup_v2
resource are failing.You can see the test output here:
http://logs.openlabtesting.org/logs/59/559/5f55582c3e249ab0d93ef4bf37ffc85e6cfeb384/check/terraform-provider-openstack-acceptance-test/1fdae5a/
via the
job-output.txt.gz
file.For example, the test
TestAccComputeV2SecGroup_importBasic
has the error message:The error message is from the Gophercloud library, denoting that the required
IPProtocol
field was omitted. This threw me for a loop because all test fixtures are setting this field (not to mention it passes on v0.11).After further debugging, I found that there is an empty entry in the rules set. Adding a debug line below this line produces:
v0.11.x:
v0.12:
This seems to be the only resource that is seeing this issue.
openstack_compute_secgroup_v2
is one of the oldest and largely unused resources in this provider, so there's probably some bad practices left in over time.Let me know if I can provide any further details on this one.
The text was updated successfully, but these errors were encountered: