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
197e466b
Commit
197e466b
authored
Aug 25, 2016
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ref(*): return resource update errors
Resolves #1058
parent
76defc62
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
upgrade.go
cmd/helm/upgrade.go
+1
-1
release_server.go
cmd/tiller/release_server.go
+1
-1
client.go
pkg/kube/client.go
+13
-3
No files found.
cmd/helm/upgrade.go
View file @
197e466b
...
@@ -125,7 +125,7 @@ func (u *upgradeCmd) run() error {
...
@@ -125,7 +125,7 @@ func (u *upgradeCmd) run() error {
_
,
err
=
u
.
client
.
UpdateRelease
(
u
.
release
,
chartPath
,
helm
.
UpdateValueOverrides
(
rawVals
),
helm
.
UpgradeDryRun
(
u
.
dryRun
),
helm
.
UpgradeDisableHooks
(
u
.
disableHooks
))
_
,
err
=
u
.
client
.
UpdateRelease
(
u
.
release
,
chartPath
,
helm
.
UpdateValueOverrides
(
rawVals
),
helm
.
UpgradeDryRun
(
u
.
dryRun
),
helm
.
UpgradeDisableHooks
(
u
.
disableHooks
))
if
err
!=
nil
{
if
err
!=
nil
{
return
prettyError
(
err
)
return
fmt
.
Errorf
(
"UPGRADE FAILED: %v"
,
prettyError
(
err
)
)
}
}
success
:=
u
.
release
+
" has been upgraded. Happy Helming!
\n
"
success
:=
u
.
release
+
" has been upgraded. Happy Helming!
\n
"
...
...
cmd/tiller/release_server.go
View file @
197e466b
...
@@ -224,7 +224,7 @@ func (s *releaseServer) performUpdate(originalRelease, updatedRelease *release.R
...
@@ -224,7 +224,7 @@ func (s *releaseServer) performUpdate(originalRelease, updatedRelease *release.R
original
:=
bytes
.
NewBufferString
(
originalRelease
.
Manifest
)
original
:=
bytes
.
NewBufferString
(
originalRelease
.
Manifest
)
modified
:=
bytes
.
NewBufferString
(
updatedRelease
.
Manifest
)
modified
:=
bytes
.
NewBufferString
(
updatedRelease
.
Manifest
)
if
err
:=
kubeCli
.
Update
(
updatedRelease
.
Namespace
,
original
,
modified
);
err
!=
nil
{
if
err
:=
kubeCli
.
Update
(
updatedRelease
.
Namespace
,
original
,
modified
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Update of %s failed: %s"
,
updatedRelease
.
Name
,
err
)
return
nil
,
err
}
}
// post-upgrade hooks
// post-upgrade hooks
...
...
pkg/kube/client.go
View file @
197e466b
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
"io"
"io"
"log"
"log"
"reflect"
"reflect"
"strings"
"time"
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
...
@@ -157,8 +158,9 @@ func (c *Client) Update(namespace string, currentReader, modifiedReader io.Reade
...
@@ -157,8 +158,9 @@ func (c *Client) Update(namespace string, currentReader, modifiedReader io.Reade
}
}
modifiedInfos
:=
[]
*
resource
.
Info
{}
modifiedInfos
:=
[]
*
resource
.
Info
{}
updateErrors
:=
[]
string
{}
modified
.
Visit
(
func
(
info
*
resource
.
Info
,
err
error
)
error
{
err
=
modified
.
Visit
(
func
(
info
*
resource
.
Info
,
err
error
)
error
{
modifiedInfos
=
append
(
modifiedInfos
,
info
)
modifiedInfos
=
append
(
modifiedInfos
,
info
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -188,15 +190,23 @@ func (c *Client) Update(namespace string, currentReader, modifiedReader io.Reade
...
@@ -188,15 +190,23 @@ func (c *Client) Update(namespace string, currentReader, modifiedReader io.Reade
if
err
:=
updateResource
(
info
,
currentObj
);
err
!=
nil
{
if
err
:=
updateResource
(
info
,
currentObj
);
err
!=
nil
{
log
.
Printf
(
"error updating the resource %s:
\n\t
%v"
,
resourceName
,
err
)
log
.
Printf
(
"error updating the resource %s:
\n\t
%v"
,
resourceName
,
err
)
return
err
updateErrors
=
append
(
updateErrors
,
err
.
Error
())
}
}
return
err
return
nil
})
})
deleteUnwantedResources
(
currentInfos
,
modifiedInfos
)
deleteUnwantedResources
(
currentInfos
,
modifiedInfos
)
if
err
!=
nil
{
return
err
}
else
if
len
(
updateErrors
)
!=
0
{
return
fmt
.
Errorf
(
strings
.
Join
(
updateErrors
,
" && "
))
}
return
nil
return
nil
}
}
// Delete deletes kubernetes resources from an io.reader
// Delete deletes kubernetes resources from an io.reader
...
...
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