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
1ad5106b
Commit
1ad5106b
authored
Nov 20, 2015
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address code review comments
parent
9041e8b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
deployer.go
manager/manager/deployer.go
+3
-5
manager.go
manager/manager/manager.go
+5
-6
No files found.
manager/manager/deployer.go
View file @
1ad5106b
...
...
@@ -38,7 +38,7 @@ type Deployer interface {
// NewDeployer returns a new initialized Deployer.
// TODO(vaikas): Add a flag for setting the timeout.
func
NewDeployer
(
url
string
)
Deployer
{
return
&
deployer
{
url
,
5
}
return
&
deployer
{
url
,
1
5
}
}
type
deployer
struct
{
...
...
@@ -126,7 +126,7 @@ func (d *deployer) callServiceWithConfiguration(method, operation string, config
return
nil
,
fmt
.
Errorf
(
"cannot unmarshal response: (%v)"
,
err
)
}
}
return
result
,
err
return
result
,
nil
}
func
(
d
*
deployer
)
callService
(
method
,
url
string
,
reader
io
.
Reader
,
callback
formatter
)
([]
byte
,
error
)
{
...
...
@@ -140,9 +140,7 @@ func (d *deployer) callService(method, url string, reader io.Reader, callback fo
}
timeout
:=
time
.
Duration
(
time
.
Duration
(
d
.
timeout
)
*
time
.
Second
)
client
:=
http
.
Client
{
Timeout
:
timeout
,
}
client
:=
http
.
Client
{
Timeout
:
timeout
}
response
,
err
:=
client
.
Do
(
request
)
if
err
!=
nil
{
return
nil
,
callback
(
err
)
...
...
manager/manager/manager.go
View file @
1ad5106b
...
...
@@ -104,9 +104,8 @@ func (m *manager) CreateDeployment(t *Template) (*Deployment, error) {
return
nil
,
err
}
actualConfig
,
err
:=
m
.
deployer
.
CreateConfiguration
(
manifest
.
ExpandedConfig
)
log
.
Printf
(
"Got Back %s"
,
actualConfig
)
if
err
!=
nil
{
actualConfig
,
createErr
:=
m
.
deployer
.
CreateConfiguration
(
manifest
.
ExpandedConfig
)
if
createErr
!=
nil
{
// Deployment failed, mark as failed
log
.
Printf
(
"CreateConfiguration failed: %v"
,
err
)
m
.
repository
.
SetDeploymentStatus
(
t
.
Name
,
FailedStatus
)
...
...
@@ -114,7 +113,7 @@ func (m *manager) CreateDeployment(t *Template) (*Deployment, error) {
// return the failure as such. Otherwise, we're going to add the manifest
// and hence resource specific errors down below.
if
actualConfig
==
nil
{
return
nil
,
e
rr
return
nil
,
createE
rr
}
}
else
{
m
.
repository
.
SetDeploymentStatus
(
t
.
Name
,
DeployedStatus
)
...
...
@@ -131,8 +130,8 @@ func (m *manager) CreateDeployment(t *Template) (*Deployment, error) {
// to a check fail (either deployment doesn't exist, or a manifest with the same
// name already exists).
// TODO(vaikas): Should we combine both errors and return a nicely formatted error for both?
if
e
rr
!=
nil
{
return
nil
,
e
rr
if
createE
rr
!=
nil
{
return
nil
,
createE
rr
}
else
{
return
nil
,
aErr
}
...
...
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