-
Notifications
You must be signed in to change notification settings - Fork 36
Plugin crash when trying to pass a computed value for a mac address #191
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
Comments
@InputObject2 thanks for the bug report. I didn't realize it was possible for this to behave this way. I need to investigate this a bit more, but if removing that validation prevents this problem it seems like a possible solution. In order to verify that the computed field is the problem, I reproduced the error with the terraform code you shared. Running I then tried to apply terraform in two steps in order to avoid the mac address being in a computed state. Using the same terraform code, I did the following:
This avoids the panic and shows that the computed aspect of the mac address is the problem. |
Thanks for the quick answer (and for the provider!). I thought I had included the 2-step apply in my initial comment, guess I left it out. My issue is that a 2-step apply won't work with modules where all the resources are created at the same time. I was hitting this while trying to package all my vm creation resources (mac, dns, ansible config, vm) into a single module. |
I wasn't suggesting that a 2-step apply was a viable workaround :). I just wanted to make sure I understood why this was a "computed property" problem, since I was surprised this was possible. So I wanted to make sure I understood how to reproduce the issue. |
Sorry for the slow response on this, but this will be fixed in v0.26.1 of the provider. |
When trying to set a vm's nic's mac address, the xenorchestra provider does not handle "computed" values because of the validation done on the mac address field, meaning that the mac's value has to be known ahead of time.
Terraform example code where the value is computed:
If XO will not accept invalid values for mac addresses, I don't think we need to have a custom validation here. We should simply forward the XO api error response to the user when they try to pass erroneous data.
The text was updated successfully, but these errors were encountered: