@@ -187,7 +187,7 @@ func NewCurrentLoadBalancer(o *NewCurrentLoadBalancerOptions) (newLoadBalancer *
187
187
188
188
attrs , err := albelbv2 .ELBV2svc .DescribeLoadBalancerAttributesFiltered (o .LoadBalancer .LoadBalancerArn )
189
189
if err != nil {
190
- return newLoadBalancer , fmt .Errorf ("Failed to retrieve attributes from ALB in AWS. Error: %s" , err .Error ())
190
+ return newLoadBalancer , fmt .Errorf ("Failed to retrieve attributes from ELBV2 in AWS. Error: %s" , err .Error ())
191
191
}
192
192
193
193
var managedSG * string
@@ -542,7 +542,7 @@ func (l *LoadBalancer) modify(rOpts *ReconcileOptions) error {
542
542
Subnets : util .AvailabilityZones (l .lb .desired .AvailabilityZones ).AsSubnets (),
543
543
}); err != nil {
544
544
rOpts .Eventf (api .EventTypeWarning , "ERROR" , "%s subnet modification failed: %s" , * l .lb .current .LoadBalancerName , err .Error ())
545
- return fmt .Errorf ("Failure Setting ALB Subnets : %s" , err )
545
+ return fmt .Errorf ("Failed setting ELBV2 subnets : %s" , err )
546
546
}
547
547
l .lb .current .AvailabilityZones = l .lb .desired .AvailabilityZones
548
548
rOpts .Eventf (api .EventTypeNormal , "MODIFY" , "%s subnets modified" , * l .lb .current .LoadBalancerName )
@@ -556,7 +556,7 @@ func (l *LoadBalancer) modify(rOpts *ReconcileOptions) error {
556
556
IpAddressType : l .lb .desired .IpAddressType ,
557
557
}); err != nil {
558
558
rOpts .Eventf (api .EventTypeNormal , "ERROR" , "%s ip address type modification failed: %s" , * l .lb .current .LoadBalancerName , err .Error ())
559
- return fmt .Errorf ("Failure Setting ALB IpAddressType : %s" , err )
559
+ return fmt .Errorf ("Failed setting ELBV2 IP address type : %s" , err )
560
560
}
561
561
l .lb .current .IpAddressType = l .lb .desired .IpAddressType
562
562
rOpts .Eventf (api .EventTypeNormal , "MODIFY" , "%s ip address type modified" , * l .lb .current .LoadBalancerName )
@@ -581,7 +581,7 @@ func (l *LoadBalancer) modify(rOpts *ReconcileOptions) error {
581
581
Attributes : l .attributes .desired ,
582
582
}); err != nil {
583
583
rOpts .Eventf (api .EventTypeWarning , "ERROR" , "%s attributes modification failed: %s" , * l .lb .current .LoadBalancerName , err .Error ())
584
- return fmt .Errorf ("Failure modifying attributes: %s" , err )
584
+ return fmt .Errorf ("Failed modifying attributes: %s" , err )
585
585
}
586
586
l .attributes .current = l .attributes .desired
587
587
rOpts .Eventf (api .EventTypeNormal , "MODIFY" , "%s attributes modified" , * l .lb .current .LoadBalancerName )
@@ -591,7 +591,7 @@ func (l *LoadBalancer) modify(rOpts *ReconcileOptions) error {
591
591
l .logger .Infof ("Associating %v Web ACL." , l .options .desired .webACLId )
592
592
if _ , err := albwaf .WAFRegionalsvc .Associate (l .lb .current .LoadBalancerArn , l .options .desired .webACLId ); err != nil {
593
593
rOpts .Eventf (api .EventTypeWarning , "ERROR" , "%s Web ACL (%s) association failed: %s" , * l .lb .current .LoadBalancerName , * l .options .desired .webACLId , err .Error ())
594
- return fmt .Errorf ("Failure associating Web ACL: %s" , err .Error ())
594
+ return fmt .Errorf ("Failed associating Web ACL: %s" , err .Error ())
595
595
} else {
596
596
l .options .current .webACLId = l .options .desired .webACLId
597
597
rOpts .Eventf (api .EventTypeNormal , "MODIFY" , "Web ACL association updated to %s" , * l .options .desired .webACLId )
@@ -602,7 +602,7 @@ func (l *LoadBalancer) modify(rOpts *ReconcileOptions) error {
602
602
l .logger .Infof ("Disassociating Web ACL." )
603
603
if _ , err := albwaf .WAFRegionalsvc .Disassociate (l .lb .current .LoadBalancerArn ); err != nil {
604
604
rOpts .Eventf (api .EventTypeWarning , "ERROR" , "%s Web ACL disassociation failed: %s" , * l .lb .current .LoadBalancerName , err .Error ())
605
- return fmt .Errorf ("Failure removing Web ACL association: %s" , err .Error ())
605
+ return fmt .Errorf ("Failed removing Web ACL association: %s" , err .Error ())
606
606
} else {
607
607
l .options .current .webACLId = l .options .desired .webACLId
608
608
rOpts .Eventf (api .EventTypeNormal , "MODIFY" , "Web ACL disassociated" )
@@ -634,8 +634,7 @@ func (l *LoadBalancer) delete(rOpts *ReconcileOptions) error {
634
634
if l .options .current .webACLId != nil {
635
635
if _ , err := albwaf .WAFRegionalsvc .Disassociate (l .lb .current .LoadBalancerArn ); err != nil {
636
636
rOpts .Eventf (api .EventTypeWarning , "ERROR" , "Error disassociating Web ACL for %s: %s" , * l .lb .current .LoadBalancerName , err .Error ())
637
- l .logger .Errorf ("Failed disassociation of ELBV2 Web ACL: %s." , err .Error ())
638
- return err
637
+ return fmt .Errorf ("Failed disassociation of ELBV2 Web ACL: %s." , err .Error ())
639
638
}
640
639
}
641
640
@@ -645,8 +644,7 @@ func (l *LoadBalancer) delete(rOpts *ReconcileOptions) error {
645
644
646
645
if _ , err := albelbv2 .ELBV2svc .DeleteLoadBalancer (in ); err != nil {
647
646
rOpts .Eventf (api .EventTypeWarning , "ERROR" , "Error deleting %s: %s" , * l .lb .current .LoadBalancerName , err .Error ())
648
- l .logger .Errorf ("Failed deletion of ELBV2: %s." , err .Error ())
649
- return err
647
+ return fmt .Errorf ("Failed deletion of ELBV2: %s." , err .Error ())
650
648
}
651
649
652
650
// if the alb controller was managing a SG we must:
@@ -658,7 +656,7 @@ func (l *LoadBalancer) delete(rOpts *ReconcileOptions) error {
658
656
if l .options .current .managedSG != nil {
659
657
if err := albec2 .EC2svc .DisassociateSGFromInstanceIfNeeded (l .targetgroups [0 ].CurrentTargets (), l .options .current .managedInstanceSG ); err != nil {
660
658
rOpts .Eventf (api .EventTypeWarning , "WARN" , "Failed disassociating sgs from instances: %s" , err .Error ())
661
- l . logger . Warnf ("Failed in deletion of managed SG: %s." , err .Error ())
659
+ return fmt . Errorf ("Failed disassociating managed SG: %s." , err .Error ())
662
660
}
663
661
if err := attemptSGDeletion (l .options .current .managedInstanceSG ); err != nil {
664
662
rOpts .Eventf (api .EventTypeWarning , "WARN" , "Failed deleting %s: %s" , * l .options .current .managedInstanceSG , err .Error ())
0 commit comments