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
1412a88c
Commit
1412a88c
authored
May 20, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tiller): stop returning deleted releases for list
parent
e3967e57
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
memory.go
pkg/storage/memory.go
+5
-5
memory_test.go
pkg/storage/memory_test.go
+12
-1
No files found.
pkg/storage/memory.go
View file @
1412a88c
...
...
@@ -70,15 +70,15 @@ func (m *Memory) Delete(name string) (*release.Release, error) {
return
rel
,
nil
}
// List returns all releases.
// List returns all releases
whose status is not Status_DELETED
.
func
(
m
*
Memory
)
List
()
([]
*
release
.
Release
,
error
)
{
m
.
RLock
()
defer
m
.
RUnlock
()
buf
:=
make
([]
*
release
.
Release
,
len
(
m
.
releases
))
i
:=
0
buf
:=
[]
*
release
.
Release
{}
for
_
,
v
:=
range
m
.
releases
{
buf
[
i
]
=
v
i
++
if
v
.
Info
.
Status
.
Code
!=
release
.
Status_DELETED
{
buf
=
append
(
buf
,
v
)
}
}
return
buf
,
nil
}
...
...
pkg/storage/memory_test.go
View file @
1412a88c
...
...
@@ -72,7 +72,18 @@ func TestList(t *testing.T) {
rels
:=
[]
string
{
"a"
,
"b"
,
"c"
}
for
_
,
k
:=
range
rels
{
ms
.
Create
(
&
release
.
Release
{
Name
:
k
})
ms
.
Create
(
&
release
.
Release
{
Name
:
k
,
Info
:
&
release
.
Info
{
Status
:
&
release
.
Status
{
Code
:
release
.
Status_UNKNOWN
},
},
})
ms
.
Create
(
&
release
.
Release
{
Name
:
"deleted-should-not-show-up"
,
Info
:
&
release
.
Info
{
Status
:
&
release
.
Status
{
Code
:
release
.
Status_DELETED
},
},
})
}
l
,
err
:=
ms
.
List
()
...
...
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