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

Fix False Error when no Outputs are Defined #21136

Closed
wants to merge 1 commit into from

Conversation

rudolphjacksonm
Copy link

@rudolphjacksonm rudolphjacksonm commented Apr 27, 2019

Addresses #18975 -- terraform returns an error when there are no outputs defined. This should arguably exit with a return code of 0 and simply log that there were no outputs defined.

There are probably better ways of doing this but I saw the issue was sitting around for a bit and thought I'd take a stab at it!

Addresses hashicorp#18975 -- terraform returns an error when there are no outputs defined
@hashicorp-cla
Copy link

hashicorp-cla commented Apr 27, 2019

CLA assistant check
All committers have signed the CLA.

@apparentlymart
Copy link
Contributor

Hi @rudolphjacksonm! Thanks for working on this, and sorry for the slow response.

I'm afraid that I ended up seeing and reviewing #23008 before I noticed that you'd made a similar change earlier, and so I've since merged that change which ended up being the same as what you proposed here. To recognize your contribution I've edited the changelog to refer to both #23008 and to this PR, since both describe the same improvement. The change should be included in the next release of Terraform.

Because the other PR is already merged, I'm going to close this one now. Thanks again for working on this, and sorry I didn't see it before now.

@getSurreal
Copy link

The change for c.Ui.Error -> c.Ui.Output is missing from #23008 and should be included.

@apparentlymart
Copy link
Contributor

Hi @getSurreal! Thanks for pointing out that difference.

The message is intentionally still going to c.Ui.Error in what we merged because then redirecting the output to a file will capture an empty result in the empty case, rather than an error message.

This text is now essentially a warning message, even though it's not annotated as one, and we conventionally send warning messages to stderr.

@getSurreal
Copy link

thanks for explaining that

@getSurreal
Copy link

Sending warnings to stderr, does cause us to change our pipelines to not fail on stderr, which I don't think is a good thing. Now something more serious could slip through accidentally.

@ghost
Copy link

ghost commented Mar 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants