Commit c0850efe authored by adieu's avatar adieu

Separate tiller into pkg and cmd so we can use tiller as a library.

parent 6b31664c
...@@ -25,9 +25,11 @@ import ( ...@@ -25,9 +25,11 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"google.golang.org/grpc" "google.golang.org/grpc"
"k8s.io/helm/cmd/tiller/environment" "k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/storage" "k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage/driver" "k8s.io/helm/pkg/storage/driver"
"k8s.io/helm/pkg/tiller"
"k8s.io/helm/pkg/tiller/environment"
) )
const ( const (
...@@ -104,6 +106,8 @@ func start(c *cobra.Command, args []string) { ...@@ -104,6 +106,8 @@ func start(c *cobra.Command, args []string) {
srvErrCh := make(chan error) srvErrCh := make(chan error)
probeErrCh := make(chan error) probeErrCh := make(chan error)
go func() { go func() {
svc := tiller.NewReleaseServer(env)
services.RegisterReleaseServiceServer(rootServer, svc)
if err := rootServer.Serve(lstn); err != nil { if err := rootServer.Serve(lstn); err != nil {
srvErrCh <- err srvErrCh <- err
} }
......
...@@ -19,8 +19,8 @@ package main ...@@ -19,8 +19,8 @@ package main
import ( import (
"testing" "testing"
"k8s.io/helm/cmd/tiller/environment"
"k8s.io/helm/pkg/engine" "k8s.io/helm/pkg/engine"
"k8s.io/helm/pkg/tiller/environment"
) )
// These are canary tests to make sure that the default server actually // These are canary tests to make sure that the default server actually
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"fmt" "fmt"
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"testing" "testing"
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"sort" "sort"
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"testing" "testing"
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"golang.org/x/net/context" "golang.org/x/net/context"
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
relutil "k8s.io/helm/pkg/releaseutil" relutil "k8s.io/helm/pkg/releaseutil"
) )
func (s *releaseServer) GetHistory(ctx context.Context, req *tpb.GetHistoryRequest) (*tpb.GetHistoryResponse, error) { func (s *ReleaseServer) GetHistory(ctx context.Context, req *tpb.GetHistoryRequest) (*tpb.GetHistoryResponse, error) {
if !checkClientVersion(ctx) { if !checkClientVersion(ctx) {
return nil, errIncompatibleVersion return nil, errIncompatibleVersion
} }
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"reflect" "reflect"
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package tiller
import ( import (
"errors" "errors"
...@@ -29,13 +29,13 @@ import ( ...@@ -29,13 +29,13 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"
"k8s.io/helm/cmd/tiller/environment"
"k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/proto/hapi/chart" "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"
"k8s.io/helm/pkg/storage/driver" "k8s.io/helm/pkg/storage/driver"
"k8s.io/helm/pkg/tiller/environment"
) )
const notesText = "my notes here" const notesText = "my notes here"
...@@ -70,8 +70,8 @@ data: ...@@ -70,8 +70,8 @@ data:
name: value name: value
` `
func rsFixture() *releaseServer { func rsFixture() *ReleaseServer {
return &releaseServer{ return &ReleaseServer{
env: mockEnvironment(), env: mockEnvironment(),
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment