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/v5/configuration"
3030 "github.com/haproxytech/client-native/v5/models"
31+
3132 "github.com/haproxytech/dataplaneapi/haproxy"
3233 "github.com/haproxytech/dataplaneapi/log"
3334)
@@ -255,6 +256,8 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) {
255256 var sn string
256257 sn , err = a .serviceNameFromEC2 (i )
257258 if err != nil {
259+ a .logErrorf ("unable to retrieve service name for the instance %s" , * i .InstanceId )
260+
258261 continue
259262 }
260263 // creating empty service in case it isn't there
@@ -268,6 +271,13 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) {
268271 }
269272 }
270273 instanceID := aws .ToString (i .InstanceId )
274+
275+ if _ , portErr := mapService [sn ].instancePortFromEC2 (i ); portErr != nil {
276+ a .logErrorf ("unable to retrieve service port for the instance %s" , * i .InstanceId )
277+
278+ continue
279+ }
280+
271281 mapService [sn ].instances [instanceID ] = i
272282 }
273283 }
You can’t perform that action at this time.
0 commit comments