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

Output screwed with interactive dialog in console #19583

Closed
yujunz opened this issue Dec 10, 2018 · 5 comments
Closed

Output screwed with interactive dialog in console #19583

yujunz opened this issue Dec 10, 2018 · 5 comments

Comments

@yujunz
Copy link

yujunz commented Dec 10, 2018

Terraform Version

Terraform v0.11.10

Terraform Configuration Files

provider "sops" {}

data "sops_file" "avindex_secret" {
  source_file = "../sops/secret.enc.json"
}

Debug Output

See carlpett/terraform-provider-sops#4

Crash Output

Expected Behavior

Pause on the interactive dialog and wait for user input to continue

Actual Behavior

Terraform output screwed with the dialog box.

Steps to Reproduce

  1. Install the terraform sops plugin as in README.
  2. create an encrypted secret with passphrase protected PGP key.
  3. terraform init
  4. terraform apply

Additional Context

References

@jbardin
Copy link
Member

jbardin commented Dec 10, 2018

Hi @yujunz,

Sorry you're having an issue with this, but it doesn't look like terraform is doing anything unexpected here. Plugins don't have control over the user UI -- they are run as a subprocess and should only respond to the defined RPC interface, and output formatted logging on stderr.

It looks like the go.mozilla.org/sops/decrypt package that the provider is using expects to be able to prompt the user for input, which isn't something that providers are intended to do. All input to a provider should come through its configuration

@jbardin jbardin closed this as completed Dec 10, 2018
@carlpett
Copy link
Contributor

Hi @jbardin,
Understood, I'll see what I can do my end to ensure the plugin errors out if the required parameters are not set. But I was somewhat surprised that this was an "honor agreement", and that the plugin could even write to stdout like that. Is it something that could/should be suppressed?

@jbardin
Copy link
Member

jbardin commented Dec 10, 2018

@carlpett, go-plugin should be preventing that already. I'm guessing whatever sop/decrypt is calling ends up grabbing the console device directly, rather than simply writing to stdout.

@carlpett
Copy link
Contributor

That is good to hear, thanks. My suspicion is that it might actually be a gpg-agent that comes alive and does it, so completely outside Terraform and any plugins themselves.

@ghost
Copy link

ghost commented Mar 30, 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 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants