Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrondier committed Jan 7, 2025
1 parent 0c4bf90 commit ff02df8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/sks_nodepool.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ description: |-
- `instance_pool_id` (String) The underlying [exoscale_instance_pool](./instance_pool.md) ID.
- `instance_prefix` (String) The string used to prefix the managed instances name (default `pool`).
- `instance_type` (String) The managed compute instances type (`<family>.<size>`, e.g. `standard.medium`; use the [Exoscale CLI](https://github.com/exoscale/cli/) - `exo compute instance-type list` - for the list of available types).
- `ipv6` (Boolean) Enable IPV6 for the nodepool nodes
- `kubelet_image_gc` (Block Set) Configuration for this nodepool's kubelet image garbage collector (see [below for nested schema](#nestedblock--kubelet_image_gc))
- `labels` (Map of String) A map of key/value labels.
- `name` (String)
Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/sks_nodepool_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ description: |-
- `instance_pool_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `instance_prefix` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `instance_type` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `ipv6` (Boolean) Match against this bool
- `labels` (Map of String) Match against key/values. Keys are matched exactly, while values may be matched as a regex if you supply a string that begins and ends with "/"
- `name` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `size` (Number) Match against this int
Expand Down Expand Up @@ -58,6 +59,7 @@ Read-Only:
- `instance_pool_id` (String)
- `instance_prefix` (String)
- `instance_type` (String)
- `ipv6` (Boolean)
- `kubelet_image_gc` (Set of Object) (see [below for nested schema](#nestedobjatt--nodepools--kubelet_image_gc))
- `labels` (Map of String)
- `name` (String)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/sks_nodepool.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ directory for complete configuration examples.
- `description` (String) A free-form text describing the pool.
- `disk_size` (Number) The managed instances disk size (GiB; default: `50`).
- `instance_prefix` (String) The string used to prefix the managed instances name (default `pool`).
- `ipv6` (Boolean) Enable IPV6 for the nodepool nodes
- `kubelet_image_gc` (Block Set) Configuration for this nodepool's kubelet image garbage collector (see [below for nested schema](#nestedblock--kubelet_image_gc))
- `labels` (Map of String) A map of key/value labels.
- `private_network_ids` (Set of String) A list of [exoscale_private_network](./private_network.md) (IDs) to be attached to the managed instances.
Expand Down
41 changes: 20 additions & 21 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

exov2 "github.com/exoscale/egoscale/v2"
exov3 "github.com/exoscale/egoscale/v3"
v3 "github.com/exoscale/egoscale/v3"

"github.com/exoscale/terraform-provider-exoscale/pkg/config"
)
Expand Down Expand Up @@ -306,73 +305,73 @@ func FindInstanceTypeByNameV3(ctx context.Context, client *exov3.Client, id stri
// In the context of converting list of IDs to resources for egoscale V3 update and
// creation requests, we're using a lot of inline funcitons, increasing reading complexity
// when one is called more than once, we should aim to regroup them here.
func AntiAffiniGroupsToAntiAffinityGroupIDs(aags []v3.AntiAffinityGroup) (ls []string) {
func AntiAffiniGroupsToAntiAffinityGroupIDs(aags []exov3.AntiAffinityGroup) (ls []string) {
ls = make([]string, len(aags))
for i, aag := range aags {
ls[i] = aag.ID.String()
}
return
}

func AntiAffinityGroupIDsToAntiAffinityGroups(ids []interface{}) (ls []v3.AntiAffinityGroup) {
ls = make([]v3.AntiAffinityGroup, len(ids))
func AntiAffinityGroupIDsToAntiAffinityGroups(ids []interface{}) (ls []exov3.AntiAffinityGroup) {
ls = make([]exov3.AntiAffinityGroup, len(ids))
for i, id := range ids {
ls[i] = v3.AntiAffinityGroup{
ID: v3.UUID(id.(string)),
ls[i] = exov3.AntiAffinityGroup{
ID: exov3.UUID(id.(string)),
}
}
return
}

func PrivateNetworksToPrivateNetworkIDs(privnets []v3.PrivateNetwork) (ls []string) {
func PrivateNetworksToPrivateNetworkIDs(privnets []exov3.PrivateNetwork) (ls []string) {
ls = make([]string, len(privnets))
for i, aag := range privnets {
ls[i] = aag.ID.String()
}
return
}

func PrivateNetworkIDsToPrivateNetworks(ids []interface{}) (ls []v3.PrivateNetwork) {
ls = make([]v3.PrivateNetwork, len(ids))
func PrivateNetworkIDsToPrivateNetworks(ids []interface{}) (ls []exov3.PrivateNetwork) {
ls = make([]exov3.PrivateNetwork, len(ids))
for i, id := range ids {
ls[i] = v3.PrivateNetwork{
ID: v3.UUID(id.(string)),
ls[i] = exov3.PrivateNetwork{
ID: exov3.UUID(id.(string)),
}
}
return
}

func SecurityGroupsToSecurityGroupIDs(sgs []v3.SecurityGroup) (ls []string) {
func SecurityGroupsToSecurityGroupIDs(sgs []exov3.SecurityGroup) (ls []string) {
ls = make([]string, len(sgs))
for i, aag := range sgs {
ls[i] = aag.ID.String()
}
return
}

func SecurityGroupIDsToSecurityGroups(ids []interface{}) (ls []v3.SecurityGroup) {
ls = make([]v3.SecurityGroup, len(ids))
func SecurityGroupIDsToSecurityGroups(ids []interface{}) (ls []exov3.SecurityGroup) {
ls = make([]exov3.SecurityGroup, len(ids))
for i, id := range ids {
ls[i] = v3.SecurityGroup{
ID: v3.UUID(id.(string)),
ls[i] = exov3.SecurityGroup{
ID: exov3.UUID(id.(string)),
}
}
return
}

func ElasticIPsToElasticIPIDs(eips []v3.ElasticIP) (ls []string) {
func ElasticIPsToElasticIPIDs(eips []exov3.ElasticIP) (ls []string) {
ls = make([]string, len(eips))
for i, aag := range eips {
ls[i] = aag.ID.String()
}
return
}

func ElasticIPIDsToElasticIPs(ids []interface{}) (ls []v3.ElasticIP) {
ls = make([]v3.ElasticIP, len(ids))
func ElasticIPIDsToElasticIPs(ids []interface{}) (ls []exov3.ElasticIP) {
ls = make([]exov3.ElasticIP, len(ids))
for i, id := range ids {
ls[i] = v3.ElasticIP{
ID: v3.UUID(id.(string)),
ls[i] = exov3.ElasticIP{
ID: exov3.UUID(id.(string)),
}
}
return
Expand Down

0 comments on commit ff02df8

Please sign in to comment.