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

vendor: update zclconf/go-cty #17055

Merged
merged 1 commit into from Jan 10, 2018

Conversation

Projects
None yet
2 participants
@minamijoyo
Contributor

minamijoyo commented Jan 8, 2018

Update go-cty to enable decode a gob encoded response from provider even if the provider uses vendored version of go-cty.

Refs: #16423 (comment)
Refs: zclconf/go-cty@14e23b1

[terraform@master]$ govendor fetch github.com/zclconf/go-cty/...
@apparentlymart

This comment has been minimized.

Contributor

apparentlymart commented Jan 10, 2018

Hi @minamijoyo!

As I noted in #16423, I want to just check to make sure that merging this isn't going to cause trouble for already-released plugins that may have older versions of cty vendored in, so I'm going to hold on this for now until I have a moment to do that testing.

If you already have a dev environment working to test this and are willing to take a look, what I'm planning to do here is build a new terraform binary with this patch applied and then try to apply a Terraform config that contains resources for a provider version that has cty vendored already. For example, aws provider v1.6.0 has a version of cty included in it from prior to the normalization of the gob identifiers.

I believe that this change should be fine since indeed without the fix from zclconf/go-cty@14e23b1 the Terraform Core and provider versions would have disagreed anyway, but I just want to make sure this wasn't somehow working before but broken after we normalize it.

@apparentlymart apparentlymart self-requested a review Jan 10, 2018

@minamijoyo

This comment has been minimized.

Contributor

minamijoyo commented Jan 10, 2018

Hi @apparentlymart, thank you for checking this!
I also checked that the terraform binary of this branch was able to communicate with aws provider v1.6.0 for a simple configuration.

provider "aws" {
  version = "= 1.6.0"
  region  = "ap-northeast-1"
}

resource "aws_security_group" "hoge" {
  name = "go-cty-test"

  ingress {
    from_port   = 80
    to_port     = 80
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }

  egress {
    from_port   = 0
    to_port     = 0
    protocol    = "-1"
    cidr_blocks = ["0.0.0.0/0"]
  }
}
$ terraform --version
Terraform v0.11.2-dev
+ provider.aws v1.6.0

Your version of Terraform is out of date! The latest version
is 0.11.2. You can update by downloading from www.terraform.io/downloads.html
[20180108]$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + aws_security_group.hoge
      id:                                    <computed>
      description:                           "Managed by Terraform"
      egress.#:                              "1"
      egress.482069346.cidr_blocks.#:        "1"
      egress.482069346.cidr_blocks.0:        "0.0.0.0/0"
      egress.482069346.description:          ""
      egress.482069346.from_port:            "0"
      egress.482069346.ipv6_cidr_blocks.#:   "0"
      egress.482069346.prefix_list_ids.#:    "0"
      egress.482069346.protocol:             "-1"
      egress.482069346.security_groups.#:    "0"
      egress.482069346.self:                 "false"
      egress.482069346.to_port:              "0"
      ingress.#:                             "1"
      ingress.2214680975.cidr_blocks.#:      "1"
      ingress.2214680975.cidr_blocks.0:      "0.0.0.0/0"
      ingress.2214680975.description:        ""
      ingress.2214680975.from_port:          "80"
      ingress.2214680975.ipv6_cidr_blocks.#: "0"
      ingress.2214680975.protocol:           "tcp"
      ingress.2214680975.security_groups.#:  "0"
      ingress.2214680975.self:               "false"
      ingress.2214680975.to_port:            "80"
      name:                                  "go-cty-test"
      owner_id:                              <computed>
      revoke_rules_on_delete:                "false"
      vpc_id:                                <computed>


Plan: 1 to add, 0 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

$ terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + aws_security_group.hoge
      id:                                    <computed>
      description:                           "Managed by Terraform"
      egress.#:                              "1"
      egress.482069346.cidr_blocks.#:        "1"
      egress.482069346.cidr_blocks.0:        "0.0.0.0/0"
      egress.482069346.description:          ""
      egress.482069346.from_port:            "0"
      egress.482069346.ipv6_cidr_blocks.#:   "0"
      egress.482069346.prefix_list_ids.#:    "0"
      egress.482069346.protocol:             "-1"
      egress.482069346.security_groups.#:    "0"
      egress.482069346.self:                 "false"
      egress.482069346.to_port:              "0"
      ingress.#:                             "1"
      ingress.2214680975.cidr_blocks.#:      "1"
      ingress.2214680975.cidr_blocks.0:      "0.0.0.0/0"
      ingress.2214680975.description:        ""
      ingress.2214680975.from_port:          "80"
      ingress.2214680975.ipv6_cidr_blocks.#: "0"
      ingress.2214680975.protocol:           "tcp"
      ingress.2214680975.security_groups.#:  "0"
      ingress.2214680975.self:               "false"
      ingress.2214680975.to_port:            "80"
      name:                                  "go-cty-test"
      owner_id:                              <computed>
      revoke_rules_on_delete:                "false"
      vpc_id:                                <computed>


Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_security_group.hoge: Creating...
  description:                           "" => "Managed by Terraform"
  egress.#:                              "" => "1"
  egress.482069346.cidr_blocks.#:        "" => "1"
  egress.482069346.cidr_blocks.0:        "" => "0.0.0.0/0"
  egress.482069346.description:          "" => ""
  egress.482069346.from_port:            "" => "0"
  egress.482069346.ipv6_cidr_blocks.#:   "" => "0"
  egress.482069346.prefix_list_ids.#:    "" => "0"
  egress.482069346.protocol:             "" => "-1"
  egress.482069346.security_groups.#:    "" => "0"
  egress.482069346.self:                 "" => "false"
  egress.482069346.to_port:              "" => "0"
  ingress.#:                             "" => "1"
  ingress.2214680975.cidr_blocks.#:      "" => "1"
  ingress.2214680975.cidr_blocks.0:      "" => "0.0.0.0/0"
  ingress.2214680975.description:        "" => ""
  ingress.2214680975.from_port:          "" => "80"
  ingress.2214680975.ipv6_cidr_blocks.#: "" => "0"
  ingress.2214680975.protocol:           "" => "tcp"
  ingress.2214680975.security_groups.#:  "" => "0"
  ingress.2214680975.self:               "" => "false"
  ingress.2214680975.to_port:            "" => "80"
  name:                                  "" => "go-cty-test"
  owner_id:                              "" => "<computed>"
  revoke_rules_on_delete:                "" => "false"
  vpc_id:                                "" => "<computed>"
aws_security_group.hoge: Still creating... (10s elapsed)
aws_security_group.hoge: Still creating... (20s elapsed)
aws_security_group.hoge: Still creating... (30s elapsed)
aws_security_group.hoge: Still creating... (40s elapsed)
aws_security_group.hoge: Still creating... (50s elapsed)
aws_security_group.hoge: Creation complete after 52s (ID: sg-e2318a9b)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
@apparentlymart

This comment has been minimized.

Contributor

apparentlymart commented Jan 10, 2018

Great! Thanks for testing that @minamijoyo.

I've been using these cty updates in a dev branch this last week too without any problems, so it looks like this is a safe change. Thanks again for making this update!

@apparentlymart apparentlymart merged commit f78fe3c into hashicorp:master Jan 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@minamijoyo

This comment has been minimized.

Contributor

minamijoyo commented Jan 11, 2018

@apparentlymart Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment