We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
panic: runtime error
example.tf
output "foo" { value = "foo" } output "bar" { value = null }
terraform plan terraform apply terraform output --json > output.json
terraform-docs markdown ./ --output-values --output-values-from ./output.json
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x93e475] goroutine 1 [running]: github.com/terraform-docs/terraform-docs/terraform.loadOutputs(0xc000165b80, 0xc000002180) /home/runner/work/terraform-docs/terraform-docs/terraform/load.go:298 +0x2d5 github.com/terraform-docs/terraform-docs/terraform.loadModuleItems(0x7ffdd7128646?, 0xc0000022a8?) /home/runner/work/terraform-docs/terraform-docs/terraform/load.go:70 +0x106 github.com/terraform-docs/terraform-docs/terraform.LoadWithOptions(0xc000002180) /home/runner/work/terraform-docs/terraform-docs/terraform/load.go:41 +0x38 github.com/terraform-docs/terraform-docs/internal/cli.generateContent(0xc000002180) /home/runner/work/terraform-docs/terraform-docs/internal/cli/run.go:326 +0x1c github.com/terraform-docs/terraform-docs/internal/cli.(*Runtime).RunEFunc(0xc00023b540, 0x0?, {0x0?, 0x0?, 0x0?}) /home/runner/work/terraform-docs/terraform-docs/internal/cli/run.go:134 +0x1e5 github.com/spf13/cobra.(*Command).execute(0xc000005200, {0xc00023b800, 0x4, 0x4}) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0xabc github.com/spf13/cobra.(*Command).ExecuteC(0xc000004300) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039 github.com/terraform-docs/terraform-docs/cmd.Execute() /home/runner/work/terraform-docs/terraform-docs/cmd/root.go:37 +0x1c main.main() /home/runner/work/terraform-docs/terraform-docs/main.go:20 +0x13
If the output value is null,, it would be skipped in terraform output.
null,
terraform output.
So output.json file will be
output.json
{ "foo": { "sensitive": false, "type": "string", "value": "foo" } }
Point in code to fix https://github.com/terraform-docs/terraform-docs/blob/master/terraform/load.go#L298
v1.2.2
v0.17.0 795d369 linux/amd64
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Steps to reproduce
example.tf
terraform plan terraform apply terraform output --json > output.json
Expected
Exists
Reason
If the output value is
null,
, it would be skipped interraform output.
So
output.json
file will bePoint in code to fix https://github.com/terraform-docs/terraform-docs/blob/master/terraform/load.go#L298
Versions
v1.2.2
v0.17.0 795d369 linux/amd64
The text was updated successfully, but these errors were encountered: