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
ec7d71cc
Commit
ec7d71cc
authored
Oct 19, 2016
by
Adnan Abdulhussein
Committed by
GitHub
Oct 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1409 from prydonius/ensure-parent-chart-notes
fix(tiller): ensure only the parent NOTES is used
parents
21084937
168b17cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
release_server.go
cmd/tiller/release_server.go
+5
-1
release_server_test.go
cmd/tiller/release_server_test.go
+47
-0
No files found.
cmd/tiller/release_server.go
View file @
ec7d71cc
...
@@ -21,6 +21,7 @@ import (
...
@@ -21,6 +21,7 @@ import (
"errors"
"errors"
"fmt"
"fmt"
"log"
"log"
"path/filepath"
"regexp"
"regexp"
"strings"
"strings"
...
@@ -678,7 +679,10 @@ func (s *releaseServer) renderResources(ch *chart.Chart, values chartutil.Values
...
@@ -678,7 +679,10 @@ func (s *releaseServer) renderResources(ch *chart.Chart, values chartutil.Values
notes
:=
""
notes
:=
""
for
k
,
v
:=
range
files
{
for
k
,
v
:=
range
files
{
if
strings
.
HasSuffix
(
k
,
notesFileSuffix
)
{
if
strings
.
HasSuffix
(
k
,
notesFileSuffix
)
{
notes
=
v
// Only apply the notes if it belongs to the parent chart
if
k
==
filepath
.
Join
(
ch
.
Metadata
.
Name
,
notesFileSuffix
)
{
notes
=
v
}
delete
(
files
,
k
)
delete
(
files
,
k
)
}
}
}
}
...
...
cmd/tiller/release_server_test.go
View file @
ec7d71cc
...
@@ -393,6 +393,53 @@ func TestInstallReleaseWithNotesRendered(t *testing.T) {
...
@@ -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
)
{
func
TestInstallReleaseDryRun
(
t
*
testing
.
T
)
{
c
:=
helm
.
NewContext
()
c
:=
helm
.
NewContext
()
rs
:=
rsFixture
()
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