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
bb84f9c2
Commit
bb84f9c2
authored
Jun 15, 2016
by
Matt Butcher
Committed by
GitHub
Jun 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #830 from technosophos/fix/non-default-engine
fix(tiller): allow different template engine
parents
3e480723
76f4ee1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
release_server.go
cmd/tiller/release_server.go
+20
-5
No files found.
cmd/tiller/release_server.go
View file @
bb84f9c2
...
@@ -13,6 +13,7 @@ import (
...
@@ -13,6 +13,7 @@ import (
"k8s.io/helm/cmd/tiller/environment"
"k8s.io/helm/cmd/tiller/environment"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/proto/hapi/release"
"k8s.io/helm/pkg/proto/hapi/release"
"k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage"
...
@@ -29,10 +30,6 @@ func init() {
...
@@ -29,10 +30,6 @@ func init() {
services
.
RegisterReleaseServiceServer
(
rootServer
,
srv
)
services
.
RegisterReleaseServiceServer
(
rootServer
,
srv
)
}
}
type
releaseServer
struct
{
env
*
environment
.
Environment
}
var
(
var
(
// errNotImplemented is a temporary error for uninmplemented callbacks.
// errNotImplemented is a temporary error for uninmplemented callbacks.
errNotImplemented
=
errors
.
New
(
"not implemented"
)
errNotImplemented
=
errors
.
New
(
"not implemented"
)
...
@@ -45,6 +42,10 @@ var (
...
@@ -45,6 +42,10 @@ var (
// ListDefaultLimit is the default limit for number of items returned in a list.
// ListDefaultLimit is the default limit for number of items returned in a list.
var
ListDefaultLimit
int64
=
512
var
ListDefaultLimit
int64
=
512
type
releaseServer
struct
{
env
*
environment
.
Environment
}
func
(
s
*
releaseServer
)
ListReleases
(
req
*
services
.
ListReleasesRequest
,
stream
services
.
ReleaseService_ListReleasesServer
)
error
{
func
(
s
*
releaseServer
)
ListReleases
(
req
*
services
.
ListReleasesRequest
,
stream
services
.
ReleaseService_ListReleasesServer
)
error
{
rels
,
err
:=
s
.
env
.
Releases
.
List
()
rels
,
err
:=
s
.
env
.
Releases
.
List
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -184,6 +185,18 @@ func (s *releaseServer) uniqName(start string) (string, error) {
...
@@ -184,6 +185,18 @@ func (s *releaseServer) uniqName(start string) (string, error) {
return
"ERROR"
,
errors
.
New
(
"no available release name found"
)
return
"ERROR"
,
errors
.
New
(
"no available release name found"
)
}
}
func
(
s
*
releaseServer
)
engine
(
ch
*
chart
.
Chart
)
environment
.
Engine
{
renderer
:=
s
.
env
.
EngineYard
.
Default
()
if
ch
.
Metadata
.
Engine
!=
""
{
if
r
,
ok
:=
s
.
env
.
EngineYard
.
Get
(
ch
.
Metadata
.
Engine
);
ok
{
renderer
=
r
}
else
{
log
.
Printf
(
"warning: %s requested non-existent template engine %s"
,
ch
.
Metadata
.
Name
,
ch
.
Metadata
.
Engine
)
}
}
return
renderer
}
func
(
s
*
releaseServer
)
InstallRelease
(
c
ctx
.
Context
,
req
*
services
.
InstallReleaseRequest
)
(
*
services
.
InstallReleaseResponse
,
error
)
{
func
(
s
*
releaseServer
)
InstallRelease
(
c
ctx
.
Context
,
req
*
services
.
InstallReleaseRequest
)
(
*
services
.
InstallReleaseResponse
,
error
)
{
if
req
.
Chart
==
nil
{
if
req
.
Chart
==
nil
{
return
nil
,
errMissingChart
return
nil
,
errMissingChart
...
@@ -211,7 +224,9 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
...
@@ -211,7 +224,9 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
files
,
err
:=
s
.
env
.
EngineYard
.
Default
()
.
Render
(
req
.
Chart
,
vals
)
renderer
:=
s
.
engine
(
req
.
Chart
)
files
,
err
:=
renderer
.
Render
(
req
.
Chart
,
vals
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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