Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
8e09d7c3
Commit
8e09d7c3
authored
4 years ago
by
AndrewChubatiuk
Browse files
Options
Download
Email Patches
Plain Diff
fixed typo
parent
02aa923a
Branches unavailable
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.4.0-rc.1
v1.4.0-beta.1
v1.3.8
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc.1
v1.3.0-beta.1
v1.2.15
v1.2.14
v1.2.13
v1.2.12
v1.2.11
v1.2.10
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc1
v1.2.0-beta1
v1.1.18
v1.1.17
v1.1.16
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.1.0-rc1
v1.1.0-beta1
v1.0.18
v1.0.17
v1.0.16
v1.0.15
v1.0.14
v1.0.13
v1.0.12
v1.0.11
v1.0.10
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
nightly
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
command/agent/consul/connect_test.go
+6
-5
command/agent/consul/connect_test.go
with
6 additions
and
5 deletions
+6
-5
command/agent/consul/connect_test.go
+
6
-
5
View file @
8e09d7c3
...
@@ -52,7 +52,7 @@ func TestConnect_newConnect(t *testing.T) {
...
@@ -52,7 +52,7 @@ func TestConnect_newConnect(t *testing.T) {
Native
:
false
,
Native
:
false
,
SidecarService
:
&
structs
.
ConsulSidecarService
{
SidecarService
:
&
structs
.
ConsulSidecarService
{
Tags
:
[]
string
{
"foo"
,
"bar"
},
Tags
:
[]
string
{
"foo"
,
"bar"
},
Port
:
"
sidecarPort
"
,
Port
:
"
connext-proxy-redis
"
,
},
},
},
testConnectNetwork
,
testConnectPorts
)
},
testConnectNetwork
,
testConnectPorts
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
@@ -94,11 +94,12 @@ func TestConnect_connectSidecarRegistration(t *testing.T) {
...
@@ -94,11 +94,12 @@ func TestConnect_connectSidecarRegistration(t *testing.T) {
_
,
err
:=
connectSidecarRegistration
(
"unknown-id"
,
&
structs
.
ConsulSidecarService
{
_
,
err
:=
connectSidecarRegistration
(
"unknown-id"
,
&
structs
.
ConsulSidecarService
{
Port
:
"unknown-label"
,
Port
:
"unknown-label"
,
},
testConnectNetwork
,
testConnectPorts
)
},
testConnectNetwork
,
testConnectPorts
)
require
.
EqualError
(
t
,
err
,
`invalid port unknown-label: port label not found`
)
require
.
EqualError
(
t
,
err
,
`invalid port
"
unknown-label
"
: port label not found`
)
})
})
t
.
Run
(
"bad proxy"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"bad proxy"
,
func
(
t
*
testing
.
T
)
{
_
,
err
:=
connectSidecarRegistration
(
"redis-service-id"
,
&
structs
.
ConsulSidecarService
{
_
,
err
:=
connectSidecarRegistration
(
"redis-service-id"
,
&
structs
.
ConsulSidecarService
{
Port
:
"connext-proxy-redis"
,
Proxy
:
&
structs
.
ConsulProxy
{
Proxy
:
&
structs
.
ConsulProxy
{
Expose
:
&
structs
.
ConsulExposeConfig
{
Expose
:
&
structs
.
ConsulExposeConfig
{
Paths
:
[]
structs
.
ConsulExposePath
{{
Paths
:
[]
structs
.
ConsulExposePath
{{
...
@@ -113,7 +114,7 @@ func TestConnect_connectSidecarRegistration(t *testing.T) {
...
@@ -113,7 +114,7 @@ func TestConnect_connectSidecarRegistration(t *testing.T) {
t
.
Run
(
"normal"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"normal"
,
func
(
t
*
testing
.
T
)
{
proxy
,
err
:=
connectSidecarRegistration
(
"redis-service-id"
,
&
structs
.
ConsulSidecarService
{
proxy
,
err
:=
connectSidecarRegistration
(
"redis-service-id"
,
&
structs
.
ConsulSidecarService
{
Tags
:
[]
string
{
"foo"
,
"bar"
},
Tags
:
[]
string
{
"foo"
,
"bar"
},
Port
:
"
sidecarPort
"
,
Port
:
"
connext-proxy-redis
"
,
},
testConnectNetwork
,
testConnectPorts
)
},
testConnectNetwork
,
testConnectPorts
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
&
api
.
AgentServiceRegistration
{
require
.
Equal
(
t
,
&
api
.
AgentServiceRegistration
{
...
@@ -362,7 +363,7 @@ func TestConnect_getConnectPort(t *testing.T) {
...
@@ -362,7 +363,7 @@ func TestConnect_getConnectPort(t *testing.T) {
To
:
23456
,
To
:
23456
,
}}}}
}}}}
ports
=
structs
.
AllocatedPorts
{{
ports
:
=
structs
.
AllocatedPorts
{{
Label
:
"foo"
,
Label
:
"foo"
,
Value
:
23456
,
Value
:
23456
,
To
:
23456
,
To
:
23456
,
...
@@ -382,7 +383,7 @@ func TestConnect_getConnectPort(t *testing.T) {
...
@@ -382,7 +383,7 @@ func TestConnect_getConnectPort(t *testing.T) {
t
.
Run
(
"no such service"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"no such service"
,
func
(
t
*
testing
.
T
)
{
_
,
err
:=
connectPort
(
"other"
,
networks
,
ports
)
_
,
err
:=
connectPort
(
"other"
,
networks
,
ports
)
require
.
EqualError
(
t
,
err
,
`
No Connect port defined for service "other"
`
)
require
.
EqualError
(
t
,
err
,
`
invalid port "other": port label not found
`
)
})
})
t
.
Run
(
"no network"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"no network"
,
func
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help