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
913905a5
Commit
913905a5
authored
Apr 12, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tiller): change environment.Engine signature
parent
fa387494
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
environment.go
cmd/tiller/environment/environment.go
+4
-1
environment_test.go
cmd/tiller/environment/environment_test.go
+5
-5
engine_test.go
pkg/engine/engine_test.go
+4
-0
No files found.
cmd/tiller/environment/environment.go
View file @
913905a5
...
...
@@ -17,10 +17,13 @@ func (y EngineYard) Get(k string) (Engine, bool) {
// For some engines, "rendering" includes both compiling and executing. (Other
// engines do not distinguish between phases.)
//
// The engine returns a map where the key is the named output entity (usually
// a file name) and the value is the rendered content of the template.
//
// An Engine must be capable of executing multiple concurrent requests, but
// without tainting one request's environment with data from another request.
type
Engine
interface
{
Render
(
*
hapi
.
Chart
,
*
hapi
.
Values
)
(
[]
byte
,
error
)
Render
(
*
hapi
.
Chart
,
*
hapi
.
Values
)
(
map
[
string
]
string
,
error
)
}
// ReleaseStorage represents a storage engine for a Release.
...
...
cmd/tiller/environment/environment_test.go
View file @
913905a5
...
...
@@ -7,10 +7,10 @@ import (
)
type
mockEngine
struct
{
out
[]
byte
out
map
[
string
]
string
}
func
(
e
*
mockEngine
)
Render
(
chrt
*
hapi
.
Chart
,
v
*
hapi
.
Values
)
(
[]
byte
,
error
)
{
func
(
e
*
mockEngine
)
Render
(
chrt
*
hapi
.
Chart
,
v
*
hapi
.
Values
)
(
map
[
string
]
string
,
error
)
{
return
e
.
out
,
nil
}
...
...
@@ -39,7 +39,7 @@ var _ ReleaseStorage = &mockReleaseStorage{}
var
_
KubeClient
=
&
mockKubeClient
{}
func
TestEngine
(
t
*
testing
.
T
)
{
eng
:=
&
mockEngine
{
out
:
[]
byte
(
"test"
)
}
eng
:=
&
mockEngine
{
out
:
map
[
string
]
string
{
"albatross"
:
"test"
}
}
env
:=
New
()
env
.
EngineYard
=
EngineYard
(
map
[
string
]
Engine
{
"test"
:
eng
})
...
...
@@ -48,8 +48,8 @@ func TestEngine(t *testing.T) {
t
.
Errorf
(
"failed to get engine from EngineYard"
)
}
else
if
out
,
err
:=
engine
.
Render
(
&
hapi
.
Chart
{},
&
hapi
.
Values
{});
err
!=
nil
{
t
.
Errorf
(
"unexpected template error: %s"
,
err
)
}
else
if
string
(
out
)
!=
"test"
{
t
.
Errorf
(
"expected 'test', got %q"
,
string
(
out
)
)
}
else
if
out
[
"albatross"
]
!=
"test"
{
t
.
Errorf
(
"expected 'test', got %q"
,
out
[
"albatross"
]
)
}
}
...
...
pkg/engine/engine_test.go
View file @
913905a5
...
...
@@ -4,8 +4,12 @@ import (
"fmt"
"sync"
"testing"
"github.com/deis/tiller/cmd/tiller/environment"
)
var
_
environment
.
Engine
=
&
Engine
{}
func
TestEngine
(
t
*
testing
.
T
)
{
e
:=
New
()
...
...
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