Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Output of plan json to stdout since v0.14.1 #637

Closed
greenu opened this issue Jun 1, 2023 · 1 comment · Fixed by #645
Closed

Output of plan json to stdout since v0.14.1 #637

greenu opened this issue Jun 1, 2023 · 1 comment · Fixed by #645
Assignees

Comments

@greenu
Copy link

greenu commented Jun 1, 2023

Hi,
I've upgraded v0.14.0 to v0.14.2 to fix some annoying bugs with deletion, however it brought terraform plan json output to stdout which is quite spammy and contains sensitive variables.

Plan: 30 to add, 0 to change, 0 to destroy.
{"format_version":"1.1","terraform_version":"1.4.6","variables":"blabla",
...huge plan json output here....
}
{"level":"info","ts":"2023-06-01T12:43:31.393Z","logger":"runner.terraform","msg":"save the plan","instance-id":"fe9710e2-10c5-4c56-9ce8-d3e14e18ac24"}

It being called here:
https://github.com/weaveworks/tf-controller/blob/d8b8c2d99ccd708fa7b154dacde0e06ade5e0faf/runner/server_plan.go#L71

and seems caused by following code:
https://github.com/weaveworks/tf-controller/blob/d8b8c2d99ccd708fa7b154dacde0e06ade5e0faf/runner/server.go#L196

Yes, I know that I can disable output with DISABLE_TF_LOGS=1 but it also disables all logs of terraform binary which is undesirable.

Possible solution is to disable output before ShowPlanFile call and re-enable after.

@chanwit
Copy link
Collaborator

chanwit commented Jun 1, 2023

Oh yes, @greenu
Thank you for bringing this up. I'll check the leaking logs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants