Skip to content

Commit

Permalink
Uncommenting the ElasticIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
elkezza committed Aug 20, 2024
1 parent f98d6bf commit 9103185
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cmd/instance_pool_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,20 @@ func (c *instancePoolCreateCmd) cmdRun(_ *cobra.Command, _ []string) error {
instancePoolReq.DeployTarget = &v3.DeployTarget{ID: deployTarget.ID}
}

//if l := len(c.ElasticIPs); l > 0 {
// instancePoolReq.ElasticIPS = make([]v3.ElasticIP, l)
// eIP, err := client.ListElasticIPS(ctx)
// if err != nil {
// return fmt.Errorf("error listing Elastic IP: %w", err)
// }
// for i := range c.ElasticIPs {
// elasticIP, err := eIP.FindElasticIP(c.ElasticIPs[i])
// if err != nil {
// return fmt.Errorf("error retrieving Elastic IP: %w", err)
// }
// instancePoolReq.ElasticIPS[i] = elasticIP
// }
//}
if l := len(c.ElasticIPs); l > 0 {
instancePoolReq.ElasticIPS = make([]v3.ElasticIP, l)
eIP, err := client.ListElasticIPS(ctx)
if err != nil {
return fmt.Errorf("error listing Elastic IP: %w", err)
}
for i := range c.ElasticIPs {
elasticIP, err := eIP.FindElasticIP(c.ElasticIPs[i])
if err != nil {
return fmt.Errorf("error retrieving Elastic IP: %w", err)
}
instancePoolReq.ElasticIPS[i] = elasticIP
}
}

instanceTypes, err := client.ListInstanceTypes(ctx)
if err != nil {
Expand Down

0 comments on commit 9103185

Please sign in to comment.