From c39db7a1c381e634c759501c27e76b272e83ef6b Mon Sep 17 00:00:00 2001 From: elkezza <47871727+elkezza@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:40:48 +0200 Subject: [PATCH] Uncommenting the ElasticIP. --- cmd/instance_pool_create.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/instance_pool_create.go b/cmd/instance_pool_create.go index 456e88e5..a6ede4c5 100644 --- a/cmd/instance_pool_create.go +++ b/cmd/instance_pool_create.go @@ -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 {