Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
321ee8cf
Commit
321ee8cf
authored
Nov 19, 2015
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flag for timeout for talking to service
parent
47a79141
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
dm.go
dm/dm.go
+7
-1
No files found.
dm/dm.go
View file @
321ee8cf
...
@@ -41,6 +41,7 @@ var (
...
@@ -41,6 +41,7 @@ var (
template_registry
=
flag
.
String
(
"registry"
,
"kubernetes/deployment-manager/templates"
,
"Github based template registry (owner/repo[/path])"
)
template_registry
=
flag
.
String
(
"registry"
,
"kubernetes/deployment-manager/templates"
,
"Github based template registry (owner/repo[/path])"
)
service
=
flag
.
String
(
"service"
,
"http://localhost:8001/api/v1/proxy/namespaces/dm/services/manager-service:manager"
,
"URL for deployment manager"
)
service
=
flag
.
String
(
"service"
,
"http://localhost:8001/api/v1/proxy/namespaces/dm/services/manager-service:manager"
,
"URL for deployment manager"
)
binary
=
flag
.
String
(
"binary"
,
"../expandybird/expansion/expansion.py"
,
"Path to template expansion binary"
)
binary
=
flag
.
String
(
"binary"
,
"../expandybird/expansion/expansion.py"
,
"Path to template expansion binary"
)
timeout
=
flag
.
Int
(
"timeout"
,
10
,
"Time in seconds to wait for response"
)
)
)
var
commands
=
[]
string
{
var
commands
=
[]
string
{
...
@@ -181,7 +182,12 @@ func callService(path, method, action string, reader io.ReadCloser) {
...
@@ -181,7 +182,12 @@ func callService(path, method, action string, reader io.ReadCloser) {
func
callHttp
(
path
,
method
,
action
string
,
reader
io
.
ReadCloser
)
string
{
func
callHttp
(
path
,
method
,
action
string
,
reader
io
.
ReadCloser
)
string
{
request
,
err
:=
http
.
NewRequest
(
method
,
path
,
reader
)
request
,
err
:=
http
.
NewRequest
(
method
,
path
,
reader
)
request
.
Header
.
Add
(
"Content-Type"
,
"application/json"
)
request
.
Header
.
Add
(
"Content-Type"
,
"application/json"
)
response
,
err
:=
http
.
DefaultClient
.
Do
(
request
)
client
:=
http
.
Client
{
Timeout
:
time
.
Duration
(
time
.
Duration
(
*
timeout
)
*
time
.
Second
),
}
response
,
err
:=
client
.
Do
(
request
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatalf
(
"cannot %s: %s
\n
"
,
action
,
err
)
log
.
Fatalf
(
"cannot %s: %s
\n
"
,
action
,
err
)
}
}
...
...
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