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

Differential updates for outscale_load_balancer_vms #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

outscale-age
Copy link

This allows to change a backend list without unregistering
untouched backends.

Fixes #54

This allows to change a backend list without unregistering
untouched backends.
@outscale-toa
Copy link
Member

Hello @outscale-age,

Thank you for your contribution, we will merge it in the next releases after QA tests.

Best Regards,

return resource.RetryableError(
fmt.Errorf("[WARN] Error, retrying: %s", err))
}
return resource.NonRetryableError(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use utils.CheckThrottling(err) function for Throttling checking ?

return resource.RetryableError(
fmt.Errorf("[WARN] Error, retrying: %s", err))
}
return resource.NonRetryableError(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

d.Set("backend_vm_ids", managed)

if managed.Len() == 0 {
log.Printf("[WARN] not expected attachments found in LBU %e", e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure %e can be used to print out string variable value

@outscale-mzi
Copy link
Collaborator

Hello @outscale-toa :)
Tests OK.

@outscale-age
Copy link
Author

Thanks for the review.

I'll check those soon.
Also, I think something is wrong with the change management algorithm in certain backend list transitions, so please do not merge yet.

@outscale-mzi
Copy link
Collaborator

outscale-mzi commented Sep 28, 2022

Hello @outscale-age , @outscale-toa ,

I found another issue when the user tries to set backend vms while creating the load balancer.

Terraform will perform the following actions:
  # outscale_load_balancer.public_lbu1 will be updated in-place
  ~ resource "outscale_load_balancer" "public_lbu1" {
      ~ backend_vm_ids                       = [
          + "i-6a761dd7",
        ]
        id                                   = "lbu-1"
        # (11 unchanged attributes hidden)


        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 1 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

outscale_load_balancer.public_lbu1: Modifying... [id=lbu-1]
╷
│ Error: Plugin did not respond
│ 
│   with outscale_load_balancer.public_lbu1,
│   on public_load_balancer_register_vms.tf line 16, in resource "outscale_load_balancer" "public_lbu1":
│   16: resource "outscale_load_balancer" "public_lbu1" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-outscale_darwin-update-lbu-vms plugin:

panic: interface conversion: interface {} is []interface {}, not *schema.Set

goroutine 42 [running]:
github.com/terraform-providers/terraform-provider-outscale/outscale.resourceOutscaleOAPILoadBalancerUpdate(0xc000174c40, {0x1b9b500?, 0xc00014e6d0?})
	/home/outscale/terraform-provider-outscale/outscale/resource_outscale_load_balancer.go:744 +0x2766
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000368dc0, 0xc000176050, 0xc000973b00, {0x1b9b500, 0xc00014e6d0})
	/home/outscale/go/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/resource.go:326 +0x3e3
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00011c380, 0xc0007df990, 0x1d97e74?, 0xf?)
	/home/outscale/go/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0x70
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00009a028, {0xc000899340?, 0x10b2586?}, 0xc000899340)
	/home/outscale/go/pkg/mod/github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:895 +0x7c5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1d4c220?, 0xc00009a028}, {0x204a1b8, 0xc000988db0}, 0xc000649860, 0x0)
	/home/outscale/go/pkg/mod/github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3305 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000212380, {0x204d810, 0xc0001f4600}, 0xc000676800, 0xc0000f1da0, 0x282b600, 0x0)
	/home/outscale/go/pkg/mod/google.golang.org/[email protected]/server.go:1194 +0xc8f
google.golang.org/grpc.(*Server).handleStream(0xc000212380, {0x204d810, 0xc0001f4600}, 0xc000676800, 0x0)
	/home/outscale/go/pkg/mod/google.golang.org/[email protected]/server.go:1517 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	/home/outscale/go/pkg/mod/google.golang.org/[email protected]/server.go:859 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/home/outscale/go/pkg/mod/google.golang.org/[email protected]/server.go:857 +0x28a

Error: The terraform-provider-outscale_darwin-update-lbu-vms plugin crashed!

The backend vms should only be set using the resource outscale_load_balancer_vms

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

Successfully merging this pull request may close these issues.

Support differential updates for outscale_load_balancer_vms
3 participants