File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import (
2828 "github.com/aws/aws-sdk-go-v2/service/ec2/types"
2929 "github.com/haproxytech/client-native/v4/configuration"
3030 "github.com/haproxytech/client-native/v4/models"
31+
3132 "github.com/haproxytech/dataplaneapi/haproxy"
3233 "github.com/haproxytech/dataplaneapi/log"
3334)
@@ -251,6 +252,8 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) {
251252 var sn string
252253 sn , err = a .serviceNameFromEC2 (i )
253254 if err != nil {
255+ a .logErrorf ("unable to retrieve service name for the instance %s" , * i .InstanceId )
256+
254257 continue
255258 }
256259 // creating empty service in case it isn't there
@@ -264,6 +267,13 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) {
264267 }
265268 }
266269 instanceID := aws .ToString (i .InstanceId )
270+
271+ if _ , portErr := mapService [sn ].instancePortFromEC2 (i ); portErr != nil {
272+ a .logErrorf ("unable to retrieve service port for the instance %s" , * i .InstanceId )
273+
274+ continue
275+ }
276+
267277 mapService [sn ].instances [instanceID ] = i
268278 }
269279 }
You can’t perform that action at this time.
0 commit comments