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
168b17cf
Commit
168b17cf
authored
Oct 18, 2016
by
Adnan Abdulhussein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tiller): ensure only the parent NOTES is used
parent
fcdb79da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
release_server.go
cmd/tiller/release_server.go
+4
-0
release_server_test.go
cmd/tiller/release_server_test.go
+47
-0
No files found.
cmd/tiller/release_server.go
View file @
168b17cf
...
...
@@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"log"
"path/filepath"
"regexp"
"strings"
...
...
@@ -678,7 +679,10 @@ func (s *releaseServer) renderResources(ch *chart.Chart, values chartutil.Values
notes
:=
""
for
k
,
v
:=
range
files
{
if
strings
.
HasSuffix
(
k
,
notesFileSuffix
)
{
// Only apply the notes if it belongs to the parent chart
if
k
==
filepath
.
Join
(
ch
.
Metadata
.
Name
,
notesFileSuffix
)
{
notes
=
v
}
delete
(
files
,
k
)
}
}
...
...
cmd/tiller/release_server_test.go
View file @
168b17cf
...
...
@@ -393,6 +393,53 @@ func TestInstallReleaseWithNotesRendered(t *testing.T) {
}
}
func
TestInstallReleaseWithChartAndDependencyNotes
(
t
*
testing
.
T
)
{
c
:=
helm
.
NewContext
()
rs
:=
rsFixture
()
// TODO: Refactor this into a mock.
req
:=
&
services
.
InstallReleaseRequest
{
Namespace
:
"spaced"
,
Chart
:
&
chart
.
Chart
{
Metadata
:
&
chart
.
Metadata
{
Name
:
"hello"
},
Templates
:
[]
*
chart
.
Template
{
{
Name
:
"hello"
,
Data
:
[]
byte
(
"hello: world"
)},
{
Name
:
"hooks"
,
Data
:
[]
byte
(
manifestWithHook
)},
{
Name
:
"NOTES.txt"
,
Data
:
[]
byte
(
notesText
)},
},
Dependencies
:
[]
*
chart
.
Chart
{
{
Metadata
:
&
chart
.
Metadata
{
Name
:
"hello"
},
Templates
:
[]
*
chart
.
Template
{
{
Name
:
"hello"
,
Data
:
[]
byte
(
"hello: world"
)},
{
Name
:
"hooks"
,
Data
:
[]
byte
(
manifestWithHook
)},
{
Name
:
"NOTES.txt"
,
Data
:
[]
byte
(
notesText
+
" child"
)},
},
},
},
},
}
res
,
err
:=
rs
.
InstallRelease
(
c
,
req
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed install: %s"
,
err
)
}
if
res
.
Release
.
Name
==
""
{
t
.
Errorf
(
"Expected release name."
)
}
rel
,
err
:=
rs
.
env
.
Releases
.
Get
(
res
.
Release
.
Name
,
res
.
Release
.
Version
)
if
err
!=
nil
{
t
.
Errorf
(
"Expected release for %s (%v)."
,
res
.
Release
.
Name
,
rs
.
env
.
Releases
)
}
t
.
Logf
(
"rel: %v"
,
rel
)
if
rel
.
Info
.
Status
.
Notes
!=
notesText
{
t
.
Fatalf
(
"Expected '%s', got '%s'"
,
notesText
,
rel
.
Info
.
Status
.
Notes
)
}
}
func
TestInstallReleaseDryRun
(
t
*
testing
.
T
)
{
c
:=
helm
.
NewContext
()
rs
:=
rsFixture
()
...
...
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