Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
59334408
Commit
59334408
authored
May 10, 2016
by
Rudi Chiarito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change default when no BE proto given, add test for that
Also improve error message when BE proto is wrong
parent
e19c069b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
aws.go
pkg/cloudprovider/providers/aws/aws.go
+3
-3
aws_test.go
pkg/cloudprovider/providers/aws/aws_test.go
+7
-2
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
59334408
...
@@ -2133,12 +2133,12 @@ func buildListener(port api.ServicePort, annotations map[string]string) (*elb.Li
...
@@ -2133,12 +2133,12 @@ func buildListener(port api.ServicePort, annotations map[string]string) (*elb.Li
if
certID
!=
""
{
if
certID
!=
""
{
instanceProtocol
=
annotations
[
ServiceAnnotationLoadBalancerBEProtocol
]
instanceProtocol
=
annotations
[
ServiceAnnotationLoadBalancerBEProtocol
]
if
instanceProtocol
==
""
{
if
instanceProtocol
==
""
{
protocol
=
"
https
"
protocol
=
"
ssl
"
instanceProtocol
=
"
htt
p"
instanceProtocol
=
"
tc
p"
}
else
{
}
else
{
protocol
=
backendProtocolMapping
[
instanceProtocol
]
protocol
=
backendProtocolMapping
[
instanceProtocol
]
if
protocol
==
""
{
if
protocol
==
""
{
return
nil
,
fmt
.
Errorf
(
"Invalid backend protocol %s
in %s"
,
instanceProtocol
,
certID
)
return
nil
,
fmt
.
Errorf
(
"Invalid backend protocol %s
for %s in %s"
,
instanceProtocol
,
certID
,
ServiceAnnotationLoadBalancerBEProtocol
)
}
}
}
}
listener
.
SSLCertificateId
=
&
certID
listener
.
SSLCertificateId
=
&
certID
...
...
pkg/cloudprovider/providers/aws/aws_test.go
View file @
59334408
...
@@ -1216,10 +1216,15 @@ func TestBuildListener(t *testing.T) {
...
@@ -1216,10 +1216,15 @@ func TestBuildListener(t *testing.T) {
}{
}{
{
{
"No cert or BE protocol annotation, passthrough"
,
"No cert or BE protocol annotation, passthrough"
,
80
,
8000
,
""
,
""
,
80
,
7999
,
""
,
""
,
false
,
"tcp"
,
"tcp"
,
""
,
false
,
"tcp"
,
"tcp"
,
""
,
},
},
{
{
"Cert annotation without BE protocol specified, SSL->TCP"
,
80
,
8000
,
""
,
"cert"
,
false
,
"ssl"
,
"tcp"
,
"cert"
,
},
{
"BE protocol without cert annotation, passthrough"
,
"BE protocol without cert annotation, passthrough"
,
443
,
8001
,
"https"
,
""
,
443
,
8001
,
"https"
,
""
,
false
,
"tcp"
,
"tcp"
,
""
,
false
,
"tcp"
,
"tcp"
,
""
,
...
@@ -1265,7 +1270,7 @@ func TestBuildListener(t *testing.T) {
...
@@ -1265,7 +1270,7 @@ func TestBuildListener(t *testing.T) {
if
test
.
certAnnotation
!=
""
{
if
test
.
certAnnotation
!=
""
{
annotations
[
ServiceAnnotationLoadBalancerCertificate
]
=
test
.
certAnnotation
annotations
[
ServiceAnnotationLoadBalancerCertificate
]
=
test
.
certAnnotation
}
}
l
,
err
:=
get
Listener
(
api
.
ServicePort
{
l
,
err
:=
build
Listener
(
api
.
ServicePort
{
NodePort
:
int32
(
test
.
instancePort
),
NodePort
:
int32
(
test
.
instancePort
),
Port
:
int32
(
test
.
lbPort
),
Port
:
int32
(
test
.
lbPort
),
Protocol
:
api
.
Protocol
(
"tcp"
),
Protocol
:
api
.
Protocol
(
"tcp"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment