File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,26 @@ func ensureLoadBalancerValidation(v *awsValidationInput) error {
53
53
func validateServiceAnnotations (v * awsValidationInput ) error {
54
54
isNLB := isNLB (v .annotations )
55
55
56
+ // ServiceAnnotationLoadBalancerSecurityGroups
57
+ // NLB only: ensure the BYO annotations are not supported and return an error.
58
+ // FIXME: the BYO SG for NLB implementation is blocked by https://github.com/kubernetes/cloud-provider-aws/pull/1209
59
+ if _ , hasBYOAnnotation := v .annotations [ServiceAnnotationLoadBalancerSecurityGroups ]; hasBYOAnnotation {
60
+ if isNLB {
61
+ return fmt .Errorf ("BYO security group annotation %q is not supported by NLB" , ServiceAnnotationLoadBalancerSecurityGroups )
62
+ }
63
+ }
64
+
65
+ // ServiceAnnotationLoadBalancerExtraSecurityGroups
66
+ if _ , hasExtraBYOAnnotation := v .annotations [ServiceAnnotationLoadBalancerExtraSecurityGroups ]; hasExtraBYOAnnotation {
67
+ if isNLB {
68
+ return fmt .Errorf ("BYO extra security group annotation %q is not supported by NLB" , ServiceAnnotationLoadBalancerExtraSecurityGroups )
69
+ }
70
+ }
71
+
56
72
// ServiceAnnotationLoadBalancerTargetGroupAttributes
57
73
if _ , present := v .annotations [ServiceAnnotationLoadBalancerTargetGroupAttributes ]; present {
58
74
if ! isNLB {
59
- return fmt .Errorf ("target group annotations attribute is only supported for NLB" )
75
+ return fmt .Errorf ("target group annotations attributes are only supported for NLB" )
60
76
}
61
77
if err := validateServiceAnnotationTargetGroupAttributes (v ); err != nil {
62
78
return err
You can’t perform that action at this time.
0 commit comments