Skip to content

Commit 16274a4

Browse files
committed
Fix docs and run goimports
1 parent 736e120 commit 16274a4

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

docs/guide/service/annotations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,11 @@ You can configure TLS support via the following annotations:
386386
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-west-2:xxxxx:certificate/xxxxxxx
387387
```
388388

389-
- <a name="ssl-domains">`service.beta.kubernetes.io/aws-load-balancer-ssl-domains`</a> specifies the domain names for the NLB to which you want auto-discover the SSL certs.
389+
- <a name="ssl-domains">`service.beta.kubernetes.io/aws-load-balancer-ssl-domains`</a> specifies the domain names for which the controller will automatically discover TLS certificates.
390390

391391
!!!note ""
392-
When both the [ssl-cert](#ssl-cert) and [ssl-domains](#ssl-domains) are specified, `service.beta.kubernetes.io/aws-load-balancer-ssl-cert` annotation
393-
takes precedence over the `service.beta.kubernetes.io/aws-load-balancer-ssl-domains`.
392+
The `service.beta.kubernetes.io/aws-load-balancer-ssl-cert` annotation takes precedence
393+
over the `service.beta.kubernetes.io/aws-load-balancer-ssl-domains` annotation.
394394

395395
!!!example
396396
```

pkg/service/model_build_listener.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,18 @@ func (t *defaultModelBuildTask) buildSSLNegotiationPolicy(_ context.Context) *st
111111
func (t *defaultModelBuildTask) buildListenerCertificates(ctx context.Context) ([]elbv2model.Certificate, error) {
112112
var rawCertificateARNs []string
113113
var rawSSLDomains []string
114-
sslCertAnnotationExists := t.annotationParser.ParseStringSliceAnnotation(annotations.SvcLBSuffixSSLCertificate, &rawCertificateARNs, t.service.Annotations)
115-
116114
var certificates []elbv2model.Certificate
117-
for _, cert := range rawCertificateARNs {
118-
certificates = append(certificates, elbv2model.Certificate{CertificateARN: aws.String(cert)})
115+
116+
if t.annotationParser.ParseStringSliceAnnotation(annotations.SvcLBSuffixSSLCertificate, &rawCertificateARNs, t.service.Annotations) {
117+
for _, cert := range rawCertificateARNs {
118+
certificates = append(certificates, elbv2model.Certificate{CertificateARN: aws.String(cert)})
119+
}
120+
return certificates, nil
119121
}
120122

121123
// auto-discover ACM certs only if the ssl-domains annotation exists ssl-cert annotations is not present
122124
// which means ssl-cert takes precedence over the auto-discovered cert/ss-domains annotation
123-
if !sslCertAnnotationExists && t.annotationParser.ParseStringSliceAnnotation(annotations.SvcLBSuffixSSLDomains, &rawSSLDomains, t.service.Annotations) {
125+
if t.annotationParser.ParseStringSliceAnnotation(annotations.SvcLBSuffixSSLDomains, &rawSSLDomains, t.service.Annotations) {
124126
autoDiscoveredCertARNs, err := t.certDiscovery.Discover(ctx, rawSSLDomains)
125127
if err != nil {
126128
return certificates, err

pkg/service/model_builder.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package service
22

33
import (
44
"context"
5+
"strconv"
6+
"sync"
7+
58
"github.com/go-logr/logr"
69
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
710
"sigs.k8s.io/aws-load-balancer-controller/pkg/ingress"
8-
"strconv"
9-
"sync"
1011

1112
"github.com/aws/aws-sdk-go/service/ec2"
1213
"github.com/go-logr/logr"

0 commit comments

Comments
 (0)