mirror of https://github.com/helm/helm
Merge pull request #26 from technosophos/feat/helm-install
feat(tiller): add release server stubpull/613/head
commit
d3cff27bf9
@ -0,0 +1,47 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"github.com/deis/tiller/cmd/tiller/environment"
|
||||||
|
"github.com/deis/tiller/pkg/proto/hapi/services"
|
||||||
|
ctx "golang.org/x/net/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
srv := &releaseServer{
|
||||||
|
env: env,
|
||||||
|
}
|
||||||
|
services.RegisterReleaseServiceServer(rootServer, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
type releaseServer struct {
|
||||||
|
env *environment.Environment
|
||||||
|
}
|
||||||
|
|
||||||
|
// errNotImplemented is a temporary error for uninmplemented callbacks.
|
||||||
|
var errNotImplemented = errors.New("not implemented")
|
||||||
|
|
||||||
|
func (s *releaseServer) ListReleases(req *services.ListReleasesRequest, stream services.ReleaseService_ListReleasesServer) error {
|
||||||
|
return errNotImplemented
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *releaseServer) GetReleaseStatus(c ctx.Context, req *services.GetReleaseStatusRequest) (*services.GetReleaseStatusResponse, error) {
|
||||||
|
return nil, errNotImplemented
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *releaseServer) GetReleaseContent(c ctx.Context, req *services.GetReleaseContentRequest) (*services.GetReleaseContentResponse, error) {
|
||||||
|
return nil, errNotImplemented
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *releaseServer) UpdateRelease(c ctx.Context, req *services.UpdateReleaseRequest) (*services.UpdateReleaseResponse, error) {
|
||||||
|
return nil, errNotImplemented
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallReleaseRequest) (*services.InstallReleaseResponse, error) {
|
||||||
|
return &services.InstallReleaseResponse{}, errNotImplemented
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *releaseServer) UninstallRelease(c ctx.Context, req *services.UninstallReleaseRequest) (*services.UninstallReleaseResponse, error) {
|
||||||
|
return nil, errNotImplemented
|
||||||
|
}
|
@ -1,46 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/deis/tiller/cmd/tiller/environment"
|
|
||||||
"github.com/deis/tiller/pkg/hapi"
|
|
||||||
ctx "golang.org/x/net/context"
|
|
||||||
"google.golang.org/grpc"
|
|
||||||
)
|
|
||||||
|
|
||||||
type server struct {
|
|
||||||
Environment *environment.Environment
|
|
||||||
}
|
|
||||||
|
|
||||||
// newServer creates a new server with the default environment.
|
|
||||||
//
|
|
||||||
// TODO: This can take a configuration object of some sort so that we can
|
|
||||||
// initialize the environment with the correct stuff.
|
|
||||||
func newServer() *server {
|
|
||||||
return &server{
|
|
||||||
Environment: environment.New(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *server) Ready(c ctx.Context, req *hapi.PingRequest) (*hapi.PingResponse, error) {
|
|
||||||
return &hapi.PingResponse{Status: "OK"}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// startServer starts a new gRPC server listening on the given address.
|
|
||||||
//
|
|
||||||
// addr must conform to the requirements of "net.Listen".
|
|
||||||
func startServer(addr string) error {
|
|
||||||
lstn, err := net.Listen("tcp", addr)
|
|
||||||
if err != nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
hserver := newServer()
|
|
||||||
|
|
||||||
srv := grpc.NewServer()
|
|
||||||
hapi.RegisterProbeServer(srv, hserver)
|
|
||||||
srv.Serve(lstn)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
Loading…
Reference in new issue