coinbase / terraform-landscape

Improve Terraform's plan output to be easier to read and understand
Apache License 2.0
1.59k stars 116 forks source link

"container_definitions" part, there is empty. #49

Closed ozbillwang closed 6 years ago

ozbillwang commented 6 years ago

Run landscape in ruby container, and get error.

Steps to duplicate the problem.

docker run -ti --rm -v $(pwd):/apps ruby:alpine sh
/ # gem install terraform_landscape
Fetching: colorize-0.8.1.gem (100%)
Successfully installed colorize-0.8.1
Fetching: highline-1.7.10.gem (100%)
Successfully installed highline-1.7.10
Fetching: commander-4.4.3.gem (100%)
Successfully installed commander-4.4.3
Fetching: diffy-3.2.0.gem (100%)
Successfully installed diffy-3.2.0
Fetching: polyglot-0.3.5.gem (100%)
Successfully installed polyglot-0.3.5
Fetching: treetop-1.6.9.gem (100%)
Successfully installed treetop-1.6.9
Fetching: terraform_landscape-0.1.17.gem (100%)
Successfully installed terraform_landscape-0.1.17
7 gems installed
/ # cd /apps

/apps # landscape < report
/usr/local/bundle/gems/commander-4.4.3/lib/commander/user_interaction.rb:334: warning: constant ::Data is deprecated

-/+ module.app.aws_ecs_task_definition.app (new resource required)
    id:                      "valencia-production-task-definition" => "<computed>"
    arn:                     "arn:aws:ecs:ap-southeast-2:497471031970:task-definition/valencia-production-task-definition:15" => "<computed>"
    container_definitions:
    network_mode:            "" => "<computed>"
    revision:                "15" => "<computed>"

in container_definitions: part, there is empty.

If I directly run landscape < report on my mac, I can show the differences.

    container_definitions:   "Application": "abc",
                                    "Project": "abc"
                                  },
                                  "environment": [
                                    {
                             -        "name": "abc",
                             -        "value": "1000"
                             +        "name": "abc",
                             +        "value": 500"
                                    },
ozbillwang commented 6 years ago

Not sure the error is related or not. I only see this error when run it in ruby container.

/usr/local/bundle/gems/commander-4.4.3/lib/commander/user_interaction.rb:334: warning: constant ::Data is deprecated

ozbillwang commented 6 years ago

UPDATES:

I see the same error constant ::Data is deprecated, also can show the container_definitions differences in container ruby and ruby:slim. So it is only the problem in container ruby:alpine.

sds commented 6 years ago

Seems like this was introduced by Ruby 2.5.0:

$ ruby -e "puts RUBY_VERSION; ::Data"

Output on Ruby 2.4.2

2.4.2

Output on Ruby 2.5.0

2.5.0
-e:1: warning: constant ::Data is deprecated

There is an open issue on the commander gem.

ozbillwang commented 6 years ago

@sds

Thanks.

Yes, I can confirm with container ruby:2.4-alpine, I don't see the error ::Data is deprecated, but the container_definitions is still empty.

Anyway, I use ruby:slim, works fine.