Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
1a01e13d
Commit
1a01e13d
authored
Nov 02, 2018
by
Jiacheng Xu
Committed by
corbot[bot]
Nov 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin/etcd: make the address of upstream optional (#2262)
Automatically submitted.
parent
05204ef1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
plugin/etcd/setup.go
plugin/etcd/setup.go
+0
-3
plugin/etcd/setup_test.go
plugin/etcd/setup_test.go
+14
-0
No files found.
plugin/etcd/setup.go
View file @
1a01e13d
...
@@ -92,9 +92,6 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
...
@@ -92,9 +92,6 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
endpoints
=
args
endpoints
=
args
case
"upstream"
:
case
"upstream"
:
args
:=
c
.
RemainingArgs
()
args
:=
c
.
RemainingArgs
()
if
len
(
args
)
==
0
{
return
nil
,
false
,
c
.
ArgErr
()
}
u
,
err
:=
upstream
.
New
(
args
)
u
,
err
:=
upstream
.
New
(
args
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
false
,
err
return
nil
,
false
,
err
...
...
plugin/etcd/setup_test.go
View file @
1a01e13d
...
@@ -30,6 +30,20 @@ func TestSetupEtcd(t *testing.T) {
...
@@ -30,6 +30,20 @@ func TestSetupEtcd(t *testing.T) {
endpoint localhost:300
endpoint localhost:300
}
}
`
,
false
,
"skydns"
,
[]
string
{
"localhost:300"
},
""
,
`
,
false
,
"skydns"
,
[]
string
{
"localhost:300"
},
""
,
},
//test for upstream
{
`etcd {
endpoint localhost:300
upstream 8.8.8.8:53 8.8.4.4:53
}`
,
false
,
"skydns"
,
[]
string
{
"localhost:300"
},
""
,
},
//test for optional upstream address
{
`etcd {
endpoint localhost:300
upstream
}`
,
false
,
"skydns"
,
[]
string
{
"localhost:300"
},
""
,
},
},
// negative
// negative
{
{
...
...
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