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
b47379cc
Commit
b47379cc
authored
Sep 08, 2016
by
fibonacci1729
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(rollback-storage): golint & removed early return from release server
parent
e2573228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
release_server.go
cmd/tiller/release_server.go
+0
-2
testing.go
pkg/storage/driver/testing.go
+6
-0
No files found.
cmd/tiller/release_server.go
View file @
b47379cc
...
...
@@ -675,12 +675,10 @@ func (s *releaseServer) UninstallRelease(c ctx.Context, req *services.UninstallR
if
!
req
.
Purge
{
if
err
:=
s
.
env
.
Releases
.
Update
(
rel
);
err
!=
nil
{
log
.
Printf
(
"uninstall: Failed to store updated release: %s"
,
err
)
return
nil
,
err
}
}
else
{
if
_
,
err
:=
s
.
env
.
Releases
.
Delete
(
rel
.
Name
,
rel
.
Version
);
err
!=
nil
{
log
.
Printf
(
"uninstall: Failed to purge the release: %s"
,
err
)
return
nil
,
err
}
}
...
...
pkg/storage/driver/testing.go
View file @
b47379cc
...
...
@@ -78,6 +78,7 @@ type MockConfigMapsInterface struct {
objects
map
[
string
]
*
api
.
ConfigMap
}
// Init initializes the MockConfigMapsInterface with the set of releases.
func
(
mock
*
MockConfigMapsInterface
)
Init
(
t
*
testing
.
T
,
releases
...*
rspb
.
Release
)
{
mock
.
objects
=
map
[
string
]
*
api
.
ConfigMap
{}
...
...
@@ -92,6 +93,7 @@ func (mock *MockConfigMapsInterface) Init(t *testing.T, releases ...*rspb.Releas
}
}
// Get returns the ConfigMap by name.
func
(
mock
*
MockConfigMapsInterface
)
Get
(
name
string
)
(
*
api
.
ConfigMap
,
error
)
{
object
,
ok
:=
mock
.
objects
[
name
]
if
!
ok
{
...
...
@@ -100,6 +102,7 @@ func (mock *MockConfigMapsInterface) Get(name string) (*api.ConfigMap, error) {
return
object
,
nil
}
// List returns the a of ConfigMaps.
func
(
mock
*
MockConfigMapsInterface
)
List
(
opts
api
.
ListOptions
)
(
*
api
.
ConfigMapList
,
error
)
{
var
list
api
.
ConfigMapList
for
_
,
cfgmap
:=
range
mock
.
objects
{
...
...
@@ -108,6 +111,7 @@ func (mock *MockConfigMapsInterface) List(opts api.ListOptions) (*api.ConfigMapL
return
&
list
,
nil
}
// Create creates a new ConfigMap.
func
(
mock
*
MockConfigMapsInterface
)
Create
(
cfgmap
*
api
.
ConfigMap
)
(
*
api
.
ConfigMap
,
error
)
{
name
:=
cfgmap
.
ObjectMeta
.
Name
if
object
,
ok
:=
mock
.
objects
[
name
];
ok
{
...
...
@@ -117,6 +121,7 @@ func (mock *MockConfigMapsInterface) Create(cfgmap *api.ConfigMap) (*api.ConfigM
return
cfgmap
,
nil
}
// Update updates a ConfigMap.
func
(
mock
*
MockConfigMapsInterface
)
Update
(
cfgmap
*
api
.
ConfigMap
)
(
*
api
.
ConfigMap
,
error
)
{
name
:=
cfgmap
.
ObjectMeta
.
Name
if
_
,
ok
:=
mock
.
objects
[
name
];
!
ok
{
...
...
@@ -126,6 +131,7 @@ func (mock *MockConfigMapsInterface) Update(cfgmap *api.ConfigMap) (*api.ConfigM
return
cfgmap
,
nil
}
// Delete deletes a ConfigMap by name.
func
(
mock
*
MockConfigMapsInterface
)
Delete
(
name
string
)
error
{
if
_
,
ok
:=
mock
.
objects
[
name
];
!
ok
{
return
kberrs
.
NewNotFound
(
api
.
Resource
(
"tests"
),
name
)
...
...
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