-
Notifications
You must be signed in to change notification settings - Fork 30
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
Rename some function #241
base: master
Are you sure you want to change the base?
Rename some function #241
Conversation
673a6c9
to
8c80f07
Compare
8c80f07
to
ffdce7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stope midway, but could you keep only the renaming in this PR, and move the change using utils.XXX in another PR, as this could introduce a breakage.
@@ -344,19 +344,3 @@ func buildOutscaleOAPIDataSourceImagesFilters(set *schema.Set) *oscgo.FiltersIma | |||
} | |||
return filters | |||
} | |||
|
|||
func expandStringValueList(configured []interface{}) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you move that to another PR please
} | ||
if ownersOk { | ||
filtersReq.SetAccountIds([]string{aids.(string)}) | ||
} | ||
if executableUsersOk { | ||
filtersReq.SetPermissionsToLaunchAccountIds(expandStringValueList(executableUsers.([]interface{}))) | ||
filtersReq.SetPermissionsToLaunchAccountIds(utils.InterfaceSliceToStringSlice(executableUsers.([]interface{}))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you move that to another PR please
@@ -337,7 +337,7 @@ func dataSourceOutscaleOAPILoadBalancerRead(d *schema.ResourceData, meta interfa | |||
} | |||
d.Set("load_balancer_type", lb.LoadBalancerType) | |||
if lb.SecurityGroups != nil { | |||
d.Set("security_groups", flattenStringList(lb.SecurityGroups)) | |||
d.Set("security_groups", utils.StringSlicePtrToInterfaceSlice(lb.SecurityGroups)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
|
||
lb, _, err := readLbs0(conn, d) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
d.Set("subregion_names", flattenStringList(lb.SubregionNames)) | ||
d.Set("subregion_names", utils.StringSlicePtrToInterfaceSlice(lb.SubregionNames)) |
There was a problem hiding this comment.
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", flattenStringList(lb.BackendVmIds)) | ||
if err := d.Set("listeners", flattenOAPIListeners(lb.Listeners)); err != nil { | ||
d.Set("backend_vm_ids", utils.StringSlicePtrToInterfaceSlice(lb.BackendVmIds)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -351,7 +351,7 @@ func dataSourceOutscaleOAPILoadBalancerRead(d *schema.ResourceData, meta interfa | |||
d.Set("secured_cookies", lb.SecuredCookies) | |||
d.Set("net_id", lb.NetId) | |||
d.Set("source_security_group", ssg) | |||
d.Set("subnets", flattenStringList(lb.Subnets)) | |||
d.Set("subnets", utils.StringSlicePtrToInterfaceSlice(lb.Subnets)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -153,7 +153,7 @@ func dataSourceOutscaleOAPILoadBalancerLDRuleRead(d *schema.ResourceData, meta i | |||
} | |||
|
|||
if lr.VmIds != nil { | |||
d.Set("vm_ids", flattenStringList(lr.VmIds)) | |||
d.Set("vm_ids", utils.StringSlicePtrToInterfaceSlice(lr.VmIds)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -166,7 +166,7 @@ func dataSourceOutscaleOAPILoadBalancerLDRulesRead(d *schema.ResourceData, meta | |||
} | |||
|
|||
if lr.VmIds != nil { | |||
l["vm_ids"] = flattenStringList(lr.VmIds) | |||
l["vm_ids"] = utils.StringSlicePtrToInterfaceSlice(lr.VmIds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -31,7 +31,7 @@ func dataSourceOutscaleOAPILBUTagsRead(d *schema.ResourceData, meta interface{}) | |||
names := ename.([]interface{}) | |||
|
|||
req := oscgo.ReadLoadBalancerTagsRequest{ | |||
LoadBalancerNames: *expandStringList(names), | |||
LoadBalancerNames: utils.InterfaceSliceToStringSlice(names), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
No description provided.