Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pål Karlsrud
helm
Commits
e780c9db
Commit
e780c9db
authored
Jan 13, 2018
by
Pål Karlsrud
Browse files
When fetching the release status of a given release, only return
a release if it's name matches the provided name.
parent
c6680231
Changes
1
Hide whitespace changes
Inline
Side-by-side
pkg/helm/fake.go
View file @
e780c9db
...
...
@@ -88,27 +88,30 @@ func (c *FakeClient) RollbackRelease(rlsName string, opts ...RollbackOption) (*r
return
nil
,
nil
}
// ReleaseStatus returns a release status response with info from the first release in the fake
// release client
// ReleaseStatus returns a release status response with info from the matching release name.
func
(
c
*
FakeClient
)
ReleaseStatus
(
rlsName
string
,
opts
...
StatusOption
)
(
*
rls
.
GetReleaseStatusResponse
,
error
)
{
if
c
.
Rels
[
0
]
!=
nil
{
return
&
rls
.
GetReleaseStatusResponse
{
Name
:
c
.
Rels
[
0
]
.
Name
,
Info
:
c
.
Rels
[
0
]
.
Info
,
Namespace
:
c
.
Rels
[
0
]
.
Namespace
,
},
nil
for
_
,
rel
:=
range
c
.
Rels
{
if
rel
.
Name
==
rlsName
{
return
&
rls
.
GetReleaseStatusResponse
{
Name
:
rel
.
Name
,
Info
:
rel
.
Info
,
Namespace
:
rel
.
Namespace
,
},
nil
}
}
return
nil
,
fmt
.
Errorf
(
"No such release: %s"
,
rlsName
)
}
// ReleaseContent returns the configuration for the
first
release in the fake release client
// ReleaseContent returns the configuration for the
matching
release
name
in the fake release client
.
func
(
c
*
FakeClient
)
ReleaseContent
(
rlsName
string
,
opts
...
ContentOption
)
(
resp
*
rls
.
GetReleaseContentResponse
,
err
error
)
{
if
len
(
c
.
Rels
)
>
0
{
resp
=
&
rls
.
GetReleaseContentResponse
{
Release
:
c
.
Rels
[
0
],
for
_
,
rel
:=
range
c
.
Rels
{
if
rel
.
Name
==
rlsName
{
return
&
rls
.
GetReleaseContentResponse
{
Release
:
rel
,
},
nil
}
}
return
resp
,
c
.
Err
return
resp
,
fmt
.
Err
orf
(
"No such release: %s"
,
rlsName
)
}
// ReleaseHistory returns a release's revision history.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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