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

Support Terraform outputs of boolean types #34

Closed
1 task done
anovikov-el opened this issue Jul 22, 2024 · 0 comments · Fixed by #36
Closed
1 task done

Support Terraform outputs of boolean types #34

anovikov-el opened this issue Jul 22, 2024 · 0 comments · Fixed by #36
Assignees
Labels
bug Something isn't working

Comments

@anovikov-el
Copy link
Contributor

Description

Currently, RMK only supports Terraform outputs of a string type, when an output is prefixed with rmk_.
https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/cluster-management/exported-environment-variables.md#exported-envi[…]ent-variables

If an output like TF_VAR_test_suites=true is provided, it is considered like a boolean type in RMK, leading to a panic.
This should be handled correctly, the boolean type should be allowed, in other cases a warning should be shown.

Steps to reproduce

Run any command with a boolean TF variable, e.g.:
TF_VAR_test_suites=true rmk cluster p -p

Expected behaviour

The boolean value like true/false is considered as a string and handled without any error.

Actual behaviour

The following panic occurs:

panic: interface conversion: interface {} is bool, not string
goroutine 1 [running]:
rmk/config.(*Config).GetTerraformOutputs(0xc0005b6480)
        /home/runner/work/rmk/rmk/config/config.go:229 +0x599
rmk/config.(*Config).InitConfig(0xc0005b6480, 0x1)
        /home/runner/work/rmk/rmk/config/config.go:124 +0x1b6
rmk/commands.Commands.clusterProvisionAction.func30(0xc0001cfcc0)
        /home/runner/work/rmk/rmk/commands/cluster_category.go:448 +0x65
github.com/urfave/cli/v2.(*Command).Run(0xc0007fd080, 0xc0001cfcc0, {0xc000036e60, 0x2, 0x2})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/command.go:279 +0x9dd
github.com/urfave/cli/v2.(*Command).Run(0xc0000be2c0, 0xc0001cfb80, {0xc0007fa6f0, 0x3, 0x3})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/command.go:272 +0xc2e
github.com/urfave/cli/v2.(*Command).Run(0xc000000000, 0xc0001cf900, {0xc0000d0040, 0x4, 0x4})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/command.go:272 +0xc2e
github.com/urfave/cli/v2.(*App).RunContext(0xc00023cc00, {0x2667a70?, 0x3093ca0}, {0xc0000d0040, 0x4, 0x4})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/app.go:337 +0x5db
github.com/urfave/cli/v2.(*App).Run(...)
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/app.go:311
main.main()
        /home/runner/work/rmk/rmk/main.go:78 +0x3f

Environment info

RMK: v0.41.0+
OS: any
Shell: any
Terminal: any

Agree to the Code of Conduct

  • I agree to follow this project's Code of Conduct
@anovikov-el anovikov-el added the bug Something isn't working label Jul 22, 2024
@apanasiuk-el apanasiuk-el linked a pull request Jul 24, 2024 that will close this issue
apanasiuk-el added a commit that referenced this issue Jul 25, 2024
apanasiuk-el added a commit that referenced this issue Jul 25, 2024
…rm-outputs-of-boolean-types

 #34 - add support Terraform outputs of boolean types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants