Skip to content

Commit

Permalink
Enable LB support
Browse files Browse the repository at this point in the history
  • Loading branch information
uzaxirr committed Nov 12, 2024
1 parent 099ba0f commit e98f0b9
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 528 deletions.
22 changes: 0 additions & 22 deletions civo/loadbalancer/datasource_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,3 @@ func dataSourceLoadBalancerRead(_ context.Context, d *schema.ResourceData, m int

return nil
}

// function to flatten the load balancer backend when is coming from the api
func flattenLoadBalancerBackend(backend []civogo.LoadBalancerBackend) []interface{} {
if backend == nil {
return nil
}

flattenedBackend := make([]interface{}, len(backend))
for i, back := range backend {
rawRule := map[string]interface{}{
"ip": back.IP,
"protocol": back.Protocol,
"source_port": back.SourcePort,
"target_port": back.TargetPort,
"health_check_port": back.HealthCheckPort,
}

flattenedBackend[i] = rawRule
}

return flattenedBackend
}
Loading

0 comments on commit e98f0b9

Please sign in to comment.