ionos-cloud / terraform-provider-profitbricks

Terraform ProfitBricks provider
https://www.terraform.io/docs/providers/profitbricks/
Mozilla Public License 2.0
3 stars 16 forks source link

Fix nic.0.dhcp & nic.0.firewall_active update have no effect #51

Closed Ntr0 closed 5 years ago

Ntr0 commented 5 years ago

This change fixes #48 and #50. It depends on https://github.com/profitbricks/profitbricks-sdk-go/pull/39 being merged.

Ntr0 commented 5 years ago

make testacc result:

==> Checking that code complies with gofmt requirements... go install TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -timeout 120m ? github.com/terraform-providers/terraform-provider-profitbricks [no test files] ^[2=== RUN TestAccDataSourceDatacenter_matching --- PASS: TestAccDataSourceDatacenter_matching (43.41s) === RUN TestAccDataSourceImage_basic --- PASS: TestAccDataSourceImage_basic (3.91s) === RUN TestAccDataSourceLocation_basic --- PASS: TestAccDataSourceLocation_basic (2.41s) === RUN TestAccResource_basic --- PASS: TestAccResource_basic (23.33s) === RUN TestAccProfitBricksDataCenter_ImportBasic --- PASS: TestAccProfitBricksDataCenter_ImportBasic (36.50s) === RUN TestAccProfitBricksFirewall_ImportBasic --- FAIL: TestAccProfitBricksFirewall_ImportBasic (467.36s) testing.go:579: Error destroying resource! WARNING: Dangling resources may exist. The full state and error is shown below.

    Error: Error applying: 1 error(s) occurred:

    * profitbricks_datacenter.foobar (destroy): 1 error(s) occurred:

    * profitbricks_datacenter.foobar: Request failed with following error: Get https://api.profitbricks.com/cloudapi/v4/requests/b198cf1e-818e-4ddd-9c76-3351c109b1ac/status?depth=5&pretty=false: stream error: stream ID 1; PROTOCOL_ERROR

    State: profitbricks_datacenter.foobar:
      ID = bbf6327d-e72a-41ea-bb79-c32d9b06bdb1
      provider = provider.profitbricks
      description = 
      location = us/las
      name = firewall-test

=== RUN TestAccProfitBricksIPBlock_ImportBasic --- PASS: TestAccProfitBricksIPBlock_ImportBasic (22.78s) === RUN TestAccProfitBricksLan_ImportBasic --- PASS: TestAccProfitBricksLan_ImportBasic (78.08s) === RUN TestAccProfitBricksNic_ImportBasic --- PASS: TestAccProfitBricksNic_ImportBasic (330.58s) === RUN TestAccProfitBricksServer_ImportBasic --- PASS: TestAccProfitBricksServer_ImportBasic (323.98s) === RUN TestProvider --- PASS: TestProvider (0.01s) === RUN TestProvider_impl --- PASS: TestProvider_impl (0.00s) === RUN TestAccProfitBricksDataCenter_Basic --- PASS: TestAccProfitBricksDataCenter_Basic (42.82s) === RUN TestAccProfitBricksFirewall_Basic --- PASS: TestAccProfitBricksFirewall_Basic (391.73s) === RUN TestAccProfitBricksGroup_Basic --- PASS: TestAccProfitBricksGroup_Basic (39.11s) === RUN TestAccProfitBricksIPBlock_Basic --- PASS: TestAccProfitBricksIPBlock_Basic (27.87s) === RUN TestAccProfitBricksLanIPFailover_Basic --- PASS: TestAccProfitBricksLanIPFailover_Basic (419.91s) === RUN TestAccProfitBricksLan_Basic --- PASS: TestAccProfitBricksLan_Basic (131.25s) === RUN TestAccProfitBricksLoadbalancer_Basic --- FAIL: TestAccProfitBricksLoadbalancer_Basic (443.13s) testing.go:518: Step 0 error: After applying this step, the plan was not empty:

    DIFF:

    UPDATE: profitbricks_loadbalancer.example
      ip: "10.13.92.226" => ""

    STATE:

    profitbricks_datacenter.foobar:
      ID = d6e87520-35d5-454f-af1e-a8a43dd25ede
      provider = provider.profitbricks
      description = 
      location = us/las
      name = loadbalancer-test
    profitbricks_loadbalancer.example:
      ID = 42c47038-fea8-4fa8-b738-f28b75bc9daa
      provider = provider.profitbricks
      datacenter_id = d6e87520-35d5-454f-af1e-a8a43dd25ede
      dhcp = true
      ip = 10.13.92.226
      name = loadbalancer
      nic_ids.# = 1
      nic_ids.0 = 5fb79b0f-dcfc-4e5d-995f-93a1c5f994cd

      Dependencies:
        profitbricks_datacenter.foobar
        profitbricks_nic.database_nic
    profitbricks_nic.database_nic:
      ID = 5fb79b0f-dcfc-4e5d-995f-93a1c5f994cd
      provider = provider.profitbricks
      datacenter_id = d6e87520-35d5-454f-af1e-a8a43dd25ede
      dhcp = true
      firewall_active = true
      ips.# = 1
      ips.0 = 10.14.246.11
      lan = 2
      name = updated
      server_id = e9761ff7-2897-4e9b-aa0e-8aceddc18fd5

      Dependencies:
        profitbricks_datacenter.foobar
        profitbricks_server.webserver
    profitbricks_server.webserver:
      ID = e9761ff7-2897-4e9b-aa0e-8aceddc18fd5
      provider = provider.profitbricks
      availability_zone = ZONE_1
      boot_volume = 97779d69-e56c-4014-ac6d-ddd5681e6cae
      cores = 1
      cpu_family = AMD_OPTERON
      datacenter_id = d6e87520-35d5-454f-af1e-a8a43dd25ede
      image_name = ubuntu-16.04
      image_password = K3tTj8G14a3EgKyNeeiY
      name = webserver
      nic.# = 1
      nic.0.dhcp = true
      nic.0.firewall.# = 0
      nic.0.firewall_active = true
      nic.0.ip = 10.10.64.11
      nic.0.ips.# = 1
      nic.0.ips.0 = 10.10.64.11
      nic.0.lan = 1
      nic.0.name = 
      nic.0.nat = false
      primary_ip = 10.10.64.11
      primary_nic = f80ab045-59a8-4938-9645-49be31e47c06
      ram = 1024
      ssh_key_path.# = 0
      volume.# = 1
      volume.0.availability_zone = AUTO
      volume.0.bus = VIRTIO
      volume.0.disk_type = SSD
      volume.0.image_aliases.# = 0
      volume.0.image_name = 
      volume.0.image_password = 
      volume.0.licence_type = LINUX
      volume.0.name = system
      volume.0.size = 5
      volume.0.ssh_key_path.# = 0

      Dependencies:
        profitbricks_datacenter.foobar

=== RUN TestAccProfitBricksNic_Basic --- PASS: TestAccProfitBricksNic_Basic (446.87s) === RUN TestAccProfitBricksServer_Basic --- PASS: TestAccProfitBricksServer_Basic (482.53s) === RUN Test_Update --- PASS: Test_Update (0.00s) === RUN TestAccProfitBricksShare_Basic --- FAIL: TestAccProfitBricksShare_Basic (98.63s) testing.go:579: Error destroying resource! WARNING: Dangling resources may exist. The full state and error is shown below.

    Error: Check failed: share for resource  still exists in group  

    State: <no state>

=== RUN TestAccProfitBricksSnapshot_Basic --- PASS: TestAccProfitBricksSnapshot_Basic (463.84s) === RUN TestAccProfitBricksUser_Basic --- FAIL: TestAccProfitBricksUser_Basic (84.70s) testing.go:579: Error destroying resource! WARNING: Dangling resources may exist. The full state and error is shown below.

    Error: Check failed: user still exists 4f5eb594-ba2c-4c09-8281-3d3fec5d359a HTTP Status: 404 
    Error Messages:Error Code: 309 Message: Resource does not exist

    State: <no state>

=== RUN TestAccProfitBricksVolume_Basic --- PASS: TestAccProfitBricksVolume_Basic (559.53s) FAIL FAIL github.com/terraform-providers/terraform-provider-profitbricks/profitbricks 4964.287s

jasmingacic commented 5 years ago

Can you update the changelog so we can merge this?

Ntr0 commented 5 years ago

Updated changelog already. Or should I also mention the go module update?

jasmingacic commented 5 years ago

Sorry I missed it completely. If you can please add go mod to the changelog.