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 {
5353func validateServiceAnnotations (v * awsValidationInput ) error {
5454 isNLB := isNLB (v .annotations )
5555
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+
5672 // ServiceAnnotationLoadBalancerTargetGroupAttributes
5773 if _ , present := v .annotations [ServiceAnnotationLoadBalancerTargetGroupAttributes ]; present {
5874 if ! isNLB {
59- return fmt .Errorf ("target group annotations attribute is only supported for NLB" )
75+ return fmt .Errorf ("target group attributes annotation is only supported for NLB" )
6076 }
6177 if err := validateServiceAnnotationTargetGroupAttributes (v ); err != nil {
6278 return err
You can’t perform that action at this time.
0 commit comments