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
e36647d1
Commit
e36647d1
authored
Jun 17, 2016
by
Matt Butcher
Committed by
GitHub
Jun 17, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #811 from mouserage/master
Templates partials
parents
ff90db6c
66d04cbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
release_server.go
cmd/tiller/release_server.go
+7
-0
release_server_test.go
cmd/tiller/release_server_test.go
+10
-0
No files found.
cmd/tiller/release_server.go
View file @
e36647d1
...
...
@@ -5,8 +5,10 @@ import (
"errors"
"fmt"
"log"
"path"
"regexp"
"sort"
"strings"
"github.com/technosophos/moniker"
ctx
"golang.org/x/net/context"
...
...
@@ -233,6 +235,11 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
b
:=
bytes
.
NewBuffer
(
nil
)
for
name
,
file
:=
range
files
{
// Ignore templates that starts with underscore to handle them as partials
if
strings
.
HasPrefix
(
path
.
Base
(
name
),
"_"
)
{
continue
}
// Ignore empty documents because the Kubernetes library can't handle
// them.
if
len
(
file
)
>
0
{
...
...
cmd/tiller/release_server_test.go
View file @
e36647d1
...
...
@@ -97,6 +97,8 @@ func TestInstallReleaseDryRun(t *testing.T) {
{
Name
:
"hello"
,
Data
:
[]
byte
(
"hello: world"
)},
{
Name
:
"goodbye"
,
Data
:
[]
byte
(
"goodbye: world"
)},
{
Name
:
"empty"
,
Data
:
[]
byte
(
""
)},
{
Name
:
"with-partials"
,
Data
:
[]
byte
(
"hello: {{ template
\"
partials/_planet
\"
. }}"
)},
{
Name
:
"partials/_planet"
,
Data
:
[]
byte
(
"Earth"
)},
},
},
DryRun
:
true
,
...
...
@@ -117,6 +119,14 @@ func TestInstallReleaseDryRun(t *testing.T) {
t
.
Errorf
(
"unexpected output: %s"
,
res
.
Release
.
Manifest
)
}
if
!
strings
.
Contains
(
res
.
Release
.
Manifest
,
"hello: Earth"
)
{
t
.
Errorf
(
"Should contain partial content. %s"
,
res
.
Release
.
Manifest
)
}
if
strings
.
Contains
(
res
.
Release
.
Manifest
,
"hello: {{ template
\"
partials/_planet
\"
. }}"
)
{
t
.
Errorf
(
"Should not contain partial templates itself. %s"
,
res
.
Release
.
Manifest
)
}
if
strings
.
Contains
(
res
.
Release
.
Manifest
,
"empty"
)
{
t
.
Errorf
(
"Should not contain template data for an empty file. %s"
,
res
.
Release
.
Manifest
)
}
...
...
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