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
b04a1cc7
Commit
b04a1cc7
authored
Apr 13, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tiller): set up Tiller environment correctly
And structure the tests better.
parent
6563f55c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
environment.go
cmd/tiller/environment/environment.go
+24
-1
engine_test.go
pkg/engine/engine_test.go
+0
-4
No files found.
cmd/tiller/environment/environment.go
View file @
b04a1cc7
package
environment
import
(
"github.com/deis/tiller/pkg/engine"
"github.com/deis/tiller/pkg/hapi"
)
const
GoTplEngine
=
"gotpl"
var
DefaultEngine
=
GoTplEngine
// EngineYard maps engine names to engine implementations.
type
EngineYard
map
[
string
]
Engine
...
...
@@ -12,6 +17,20 @@ func (y EngineYard) Get(k string) (Engine, bool) {
return
e
,
ok
}
// Default returns the default template engine.
//
// The default is specified by DefaultEngine.
//
// If the default template engine cannot be found, this panics.
func
(
y
EngineYard
)
Default
()
Engine
{
d
,
ok
:=
y
[
DefaultEngine
]
if
!
ok
{
// This is a developer error!
panic
(
"Default template engine does not exist"
)
}
return
d
}
// Engine represents a template engine that can render templates.
//
// For some engines, "rendering" includes both compiling and executing. (Other
...
...
@@ -55,5 +74,9 @@ type Environment struct {
// New returns an environment initialized with the defaults.
func
New
()
*
Environment
{
return
&
Environment
{}
e
:=
engine
.
New
()
var
ey
EngineYard
=
map
[
string
]
Engine
{
GoTplEngine
:
e
}
return
&
Environment
{
EngineYard
:
ey
,
}
}
pkg/engine/engine_test.go
View file @
b04a1cc7
...
...
@@ -4,12 +4,8 @@ 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