Open dkyanakiev opened 1 year ago
Thanks for the suggestion @dkyanakiev.
I believe warnings are only supported in the new provider framework so we currently don't have a way to surface messages like these.
I will keep this issue open so we can work on it whenever we migrate to the provider framework.
Hmm, I see. What about using the https://developer.hashicorp.com/terraform/plugin/log/managing#log-levels + https://developer.hashicorp.com/terraform/plugin/log/writing , warn level with the exception that ppl might have to set TF_LOG_PROVIDER=WARN - seems to be supported in the sdk2. @lgfa29 - I'll try and test it out myself
Ah yes, we could use that for now. Usually those logs are for dev debugging but given the lack of alternatives that's probably the best we can do at this point.
Hi there,
Terraform Version
Nomad Version
build: 1.5.1+ent
Provider Configuration
Which values are you setting in the provider configuration?
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
https://gist.github.com/dkyanakiev/e26aab001fd7b0ea6c47aaf38be45e94
Expected Behavior
When running and applying to receive the following massage
Actual Behavior
We currently have multiple Sentinel policies in place to track and enforce various things. We noticed that policies that are set as warning never actually print anything out once you do
terraform apply
If the policy is meant to stop you from deploying you would immediately see the error on apply but warnings are dropped.Steps to Reproduce
terraform apply
Important Factoids
Please list the steps required to reproduce the issue, for example: The one of the sentinel policies we have applied - https://gist.github.com/dkyanakiev/9ef5a958eea67f6a837cfaa2c4a2ad3f It checks for labels (Note: We did notice another issue in terms of how labels are rendered but thats not relevant for the overall results) Any warning level policy would be enough
References
https://github.com/hashicorp/nomad/blob/v1.5.8/command/job_plan.go#L317 Noticed that the nomad client actually looks for warnings and displays them, so its just a matter of actually looking for those warnings on the resource level . Currently its only checking for errors but warnings should be displayed as terraform warnings as well