Commit 52c54b09 authored by Maciej Kwiek's avatar Maciej Kwiek Committed by Maciej Kwiek

Move rudder proto to different package, add release status

parent 3cba189f
...@@ -20,6 +20,10 @@ services_ias = $(subst $(space),$(comma),$(addsuffix =$(import_path)/$(services_ ...@@ -20,6 +20,10 @@ services_ias = $(subst $(space),$(comma),$(addsuffix =$(import_path)/$(services_
services_pbs = $(sort $(wildcard hapi/services/*.proto)) services_pbs = $(sort $(wildcard hapi/services/*.proto))
services_pkg = services services_pkg = services
rudder_ias = $(subst $(space),$(comma),$(addsuffix =$(import_path)/$(rudder_pkg),$(addprefix M,$(rudder_pbs))))
rudder_pbs = $(sort $(wildcard hapi/rudder/*.proto))
rudder_pkg = rudder
version_ias = $(subst $(space),$(comma),$(addsuffix =$(import_path)/$(version_pkg),$(addprefix M,$(version_pbs)))) version_ias = $(subst $(space),$(comma),$(addsuffix =$(import_path)/$(version_pkg),$(addprefix M,$(version_pbs))))
version_pbs = $(sort $(wildcard hapi/version/*.proto)) version_pbs = $(sort $(wildcard hapi/version/*.proto))
version_pkg = version version_pkg = version
...@@ -27,7 +31,7 @@ version_pkg = version ...@@ -27,7 +31,7 @@ version_pkg = version
google_deps = Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any google_deps = Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any
.PHONY: all .PHONY: all
all: chart release services version all: chart release services rudder version
.PHONY: chart .PHONY: chart
chart: chart:
...@@ -41,6 +45,10 @@ release: ...@@ -41,6 +45,10 @@ release:
services: services:
PATH=../bin:$(PATH) protoc --$(target)_out=plugins=$(plugins),$(google_deps),$(chart_ias),$(version_ias),$(release_ias):$(dst) $(services_pbs) PATH=../bin:$(PATH) protoc --$(target)_out=plugins=$(plugins),$(google_deps),$(chart_ias),$(version_ias),$(release_ias):$(dst) $(services_pbs)
.PHONY: rudder
rudder:
PATH=../bin:$(PATH) protoc --$(target)_out=plugins=$(plugins),$(google_deps),$(chart_ias),$(version_ias),$(release_ias):$(dst) $(rudder_pbs)
.PHONY: version .PHONY: version
version: version:
PATH=../bin:$(PATH) protoc --$(target)_out=plugins=$(plugins),$(google_deps):$(dst) $(version_pbs) PATH=../bin:$(PATH) protoc --$(target)_out=plugins=$(plugins),$(google_deps):$(dst) $(version_pbs)
......
// Copyright 2017 The Kubernetes Authors All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3"; syntax = "proto3";
package hapi.release; package hapi.services.rudder;
import "hapi/release/info.proto";
import "hapi/release/release.proto"; import "hapi/release/release.proto";
option go_package = "release"; option go_package = "rudder";
service ReleaseModuleService { service ReleaseModuleService {
rpc Version(VersionReleaseRequest) returns (VersionReleaseResponse) { rpc Version(VersionReleaseRequest) returns (VersionReleaseResponse) {
...@@ -25,6 +40,10 @@ service ReleaseModuleService { ...@@ -25,6 +40,10 @@ service ReleaseModuleService {
// UpgradeRelease updates release content. // UpgradeRelease updates release content.
rpc UpgradeRelease(UpgradeReleaseRequest) returns (UpgradeReleaseResponse) { rpc UpgradeRelease(UpgradeReleaseRequest) returns (UpgradeReleaseResponse) {
} }
// ReleaseStatus retrieves release status.
rpc ReleaseStatus(ReleaseStatusRequest) returns (ReleaseStatusResponse) {
}
} }
message Result { message Result {
...@@ -89,3 +108,11 @@ message RollbackReleaseResponse{ ...@@ -89,3 +108,11 @@ message RollbackReleaseResponse{
hapi.release.Release release = 1; hapi.release.Release release = 1;
Result result = 2; Result result = 2;
} }
message ReleaseStatusRequest{
hapi.release.Release release = 1;
}
message ReleaseStatusResponse{
hapi.release.Release release = 1;
hapi.release.Info info = 2;
}
...@@ -26,7 +26,7 @@ import ( ...@@ -26,7 +26,7 @@ import (
"google.golang.org/grpc/grpclog" "google.golang.org/grpc/grpclog"
"k8s.io/helm/pkg/kube" "k8s.io/helm/pkg/kube"
"k8s.io/helm/pkg/proto/hapi/release" rudderAPI "k8s.io/helm/pkg/proto/hapi/rudder"
"k8s.io/helm/pkg/rudder" "k8s.io/helm/pkg/rudder"
"k8s.io/helm/pkg/version" "k8s.io/helm/pkg/version"
) )
...@@ -39,57 +39,63 @@ func main() { ...@@ -39,57 +39,63 @@ func main() {
grpclog.Fatalf("failed to listen: %v", err) grpclog.Fatalf("failed to listen: %v", err)
} }
grpcServer := grpc.NewServer() grpcServer := grpc.NewServer()
release.RegisterReleaseModuleServiceServer(grpcServer, &ReleaseModuleServiceServer{}) rudderAPI.RegisterReleaseModuleServiceServer(grpcServer, &ReleaseModuleServiceServer{})
grpclog.Print("Server starting") grpclog.Print("Server starting")
grpcServer.Serve(lis) grpcServer.Serve(lis)
grpclog.Print("Server started") grpclog.Print("Server started")
} }
// ReleaseModuleServiceServer provides implementation for release.ReleaseModuleServiceServer // ReleaseModuleServiceServer provides implementation for rudderAPI.ReleaseModuleServiceServer
type ReleaseModuleServiceServer struct{} type ReleaseModuleServiceServer struct{}
// Version is not yet implemented // Version is not yet implemented
func (r *ReleaseModuleServiceServer) Version(ctx context.Context, in *release.VersionReleaseRequest) (*release.VersionReleaseResponse, error) { func (r *ReleaseModuleServiceServer) Version(ctx context.Context, in *rudderAPI.VersionReleaseRequest) (*rudderAPI.VersionReleaseResponse, error) {
grpclog.Print("version") grpclog.Print("version")
return &release.VersionReleaseResponse{ return &rudderAPI.VersionReleaseResponse{
Name: "helm-rudder-native", Name: "helm-rudder-native",
Version: version.Version, Version: version.Version,
}, nil }, nil
} }
// InstallRelease creates a release using kubeClient.Create // InstallRelease creates a release using kubeClient.Create
func (r *ReleaseModuleServiceServer) InstallRelease(ctx context.Context, in *release.InstallReleaseRequest) (*release.InstallReleaseResponse, error) { func (r *ReleaseModuleServiceServer) InstallRelease(ctx context.Context, in *rudderAPI.InstallReleaseRequest) (*rudderAPI.InstallReleaseResponse, error) {
grpclog.Print("install") grpclog.Print("install")
b := bytes.NewBufferString(in.Release.Manifest) b := bytes.NewBufferString(in.Release.Manifest)
err := kubeClient.Create(in.Release.Namespace, b, 500, false) err := kubeClient.Create(in.Release.Namespace, b, 500, false)
if err != nil { if err != nil {
grpclog.Printf("error when creating release: %s", err) grpclog.Printf("error when creating release: %s", err)
} }
return &release.InstallReleaseResponse{}, err return &rudderAPI.InstallReleaseResponse{}, err
} }
// DeleteRelease is not implemented // DeleteRelease is not implemented
func (r *ReleaseModuleServiceServer) DeleteRelease(ctx context.Context, in *release.DeleteReleaseRequest) (*release.DeleteReleaseResponse, error) { func (r *ReleaseModuleServiceServer) DeleteRelease(ctx context.Context, in *rudderAPI.DeleteReleaseRequest) (*rudderAPI.DeleteReleaseResponse, error) {
grpclog.Print("delete") grpclog.Print("delete")
return nil, nil return nil, nil
} }
// RollbackRelease is not implemented // RollbackRelease is not implemented
func (r *ReleaseModuleServiceServer) RollbackRelease(ctx context.Context, in *release.RollbackReleaseRequest) (*release.RollbackReleaseResponse, error) { func (r *ReleaseModuleServiceServer) RollbackRelease(ctx context.Context, in *rudderAPI.RollbackReleaseRequest) (*rudderAPI.RollbackReleaseResponse, error) {
grpclog.Print("rollback") grpclog.Print("rollback")
c := bytes.NewBufferString(in.Current.Manifest) c := bytes.NewBufferString(in.Current.Manifest)
t := bytes.NewBufferString(in.Target.Manifest) t := bytes.NewBufferString(in.Target.Manifest)
err := kubeClient.Update(in.Target.Namespace, c, t, in.Recreate, in.Timeout, in.Wait) err := kubeClient.Update(in.Target.Namespace, c, t, in.Recreate, in.Timeout, in.Wait)
return &release.RollbackReleaseResponse{}, err return &rudderAPI.RollbackReleaseResponse{}, err
} }
// UpgradeRelease upgrades manifests using kubernetes client // UpgradeRelease upgrades manifests using kubernetes client
func (r *ReleaseModuleServiceServer) UpgradeRelease(ctx context.Context, in *release.UpgradeReleaseRequest) (*release.UpgradeReleaseResponse, error) { func (r *ReleaseModuleServiceServer) UpgradeRelease(ctx context.Context, in *rudderAPI.UpgradeReleaseRequest) (*rudderAPI.UpgradeReleaseResponse, error) {
grpclog.Print("upgrade") grpclog.Print("upgrade")
c := bytes.NewBufferString(in.Current.Manifest) c := bytes.NewBufferString(in.Current.Manifest)
t := bytes.NewBufferString(in.Target.Manifest) t := bytes.NewBufferString(in.Target.Manifest)
err := kubeClient.Update(in.Target.Namespace, c, t, in.Recreate, in.Timeout, in.Wait) err := kubeClient.Update(in.Target.Namespace, c, t, in.Recreate, in.Timeout, in.Wait)
// upgrade response object should be changed to include status // upgrade response object should be changed to include status
return &release.UpgradeReleaseResponse{}, err return &rudderAPI.UpgradeReleaseResponse{}, err
}
func (r *ReleaseModuleServiceServer) ReleaseStatus(context.Context, *rudderAPI.ReleaseStatusRequest) (*rudderAPI.ReleaseStatusResponse, error) {
grpclog.Print("status")
return &rudderAPI.ReleaseStatusResponse{}, nil
} }
...@@ -101,7 +101,7 @@ func init() { proto.RegisterFile("hapi/chart/chart.proto", fileDescriptor0) } ...@@ -101,7 +101,7 @@ func init() { proto.RegisterFile("hapi/chart/chart.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
// 242 bytes of a gzipped FileDescriptorProto // 242 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xc3, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xc3, 0x30,
0x10, 0x86, 0x15, 0x4a, 0x0a, 0x1c, 0x2c, 0x58, 0x08, 0x4c, 0xa7, 0x8a, 0x09, 0x75, 0x70, 0x50, 0x10, 0x86, 0x15, 0x4a, 0x0a, 0x1c, 0x2c, 0x58, 0x08, 0x4c, 0xa7, 0x8a, 0x09, 0x75, 0x70, 0x50,
0x11, 0x0f, 0x00, 0xcc, 0x2c, 0x16, 0x13, 0xdb, 0xb5, 0xb9, 0xa4, 0x91, 0x52, 0x3b, 0xaa, 0x5d, 0x11, 0x0f, 0x00, 0xcc, 0x2c, 0x16, 0x13, 0xdb, 0xb5, 0xb9, 0xa4, 0x91, 0x52, 0x3b, 0xaa, 0x5d,
0xa4, 0xbe, 0x3b, 0x03, 0xea, 0xd9, 0xa6, 0x09, 0xea, 0x12, 0x29, 0xf7, 0x7d, 0xff, 0xe5, 0xbf, 0xa4, 0xbe, 0x3b, 0x03, 0xea, 0xd9, 0xa6, 0x09, 0xea, 0x12, 0x29, 0xf7, 0x7d, 0xff, 0xe5, 0xbf,
......
...@@ -64,7 +64,7 @@ func init() { proto.RegisterFile("hapi/chart/config.proto", fileDescriptor1) } ...@@ -64,7 +64,7 @@ func init() { proto.RegisterFile("hapi/chart/config.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{ var fileDescriptor1 = []byte{
// 182 bytes of a gzipped FileDescriptorProto // 182 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x48, 0x2c, 0xc8, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x48, 0x2c, 0xc8,
0xd4, 0x4f, 0xce, 0x48, 0x2c, 0x2a, 0xd1, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x2b, 0x28, 0xd4, 0x4f, 0xce, 0x48, 0x2c, 0x2a, 0xd1, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x2b, 0x28,
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x02, 0x49, 0xe8, 0x81, 0x25, 0x94, 0x16, 0x30, 0x72, 0xb1, 0x39, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x02, 0x49, 0xe8, 0x81, 0x25, 0x94, 0x16, 0x30, 0x72, 0xb1, 0x39,
0x83, 0x25, 0x85, 0x04, 0xb8, 0x98, 0x8b, 0x12, 0xcb, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x83, 0x25, 0x85, 0x04, 0xb8, 0x98, 0x8b, 0x12, 0xcb, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83,
......
...@@ -51,7 +51,7 @@ func init() { proto.RegisterFile("hapi/chart/template.proto", fileDescriptor3) } ...@@ -51,7 +51,7 @@ func init() { proto.RegisterFile("hapi/chart/template.proto", fileDescriptor3) }
var fileDescriptor3 = []byte{ var fileDescriptor3 = []byte{
// 107 bytes of a gzipped FileDescriptorProto // 107 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x48, 0x2c, 0xc8, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x48, 0x2c, 0xc8,
0xd4, 0x4f, 0xce, 0x48, 0x2c, 0x2a, 0xd1, 0x2f, 0x49, 0xcd, 0x2d, 0xc8, 0x49, 0x2c, 0x49, 0xd5, 0xd4, 0x4f, 0xce, 0x48, 0x2c, 0x2a, 0xd1, 0x2f, 0x49, 0xcd, 0x2d, 0xc8, 0x49, 0x2c, 0x49, 0xd5,
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x02, 0x49, 0xe9, 0x81, 0xa5, 0x94, 0x8c, 0xb8, 0x38, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x02, 0x49, 0xe9, 0x81, 0xa5, 0x94, 0x8c, 0xb8, 0x38,
0x42, 0xa0, 0xb2, 0x42, 0x42, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x42, 0xa0, 0xb2, 0x42, 0x42, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a,
......
...@@ -8,7 +8,6 @@ Package release is a generated protocol buffer package. ...@@ -8,7 +8,6 @@ Package release is a generated protocol buffer package.
It is generated from these files: It is generated from these files:
hapi/release/hook.proto hapi/release/hook.proto
hapi/release/info.proto hapi/release/info.proto
hapi/release/modules.proto
hapi/release/release.proto hapi/release/release.proto
hapi/release/status.proto hapi/release/status.proto
hapi/release/test_run.proto hapi/release/test_run.proto
...@@ -17,17 +16,6 @@ It is generated from these files: ...@@ -17,17 +16,6 @@ It is generated from these files:
It has these top-level messages: It has these top-level messages:
Hook Hook
Info Info
Result
VersionReleaseRequest
VersionReleaseResponse
InstallReleaseRequest
InstallReleaseResponse
DeleteReleaseRequest
DeleteReleaseResponse
UpgradeReleaseRequest
UpgradeReleaseResponse
RollbackReleaseRequest
RollbackReleaseResponse
Release Release
Status Status
TestRun TestRun
......
...@@ -73,7 +73,7 @@ func init() { proto.RegisterFile("hapi/release/info.proto", fileDescriptor1) } ...@@ -73,7 +73,7 @@ func init() { proto.RegisterFile("hapi/release/info.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{ var fileDescriptor1 = []byte{
// 235 bytes of a gzipped FileDescriptorProto // 235 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x8f, 0x31, 0x4f, 0xc3, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0x31, 0x4f, 0xc3, 0x30,
0x10, 0x85, 0x95, 0x52, 0x5a, 0xd5, 0x6d, 0x19, 0x2c, 0x24, 0x42, 0x16, 0x22, 0xa6, 0x0e, 0xc8, 0x10, 0x85, 0x95, 0x52, 0x5a, 0xd5, 0x6d, 0x19, 0x2c, 0x24, 0x42, 0x16, 0x22, 0xa6, 0x0e, 0xc8,
0x91, 0x80, 0x1d, 0x81, 0xba, 0xb0, 0x06, 0x26, 0x16, 0xe4, 0xe2, 0x73, 0xb1, 0xe4, 0xe6, 0x2c, 0x91, 0x80, 0x1d, 0x81, 0xba, 0xb0, 0x06, 0x26, 0x16, 0xe4, 0xe2, 0x73, 0xb1, 0xe4, 0xe6, 0x2c,
0xfb, 0x3a, 0xf0, 0x2f, 0xf8, 0xc9, 0xa8, 0xb6, 0x83, 0xd2, 0xa9, 0xab, 0xbf, 0xf7, 0x3e, 0xbf, 0xfb, 0x3a, 0xf0, 0x2f, 0xf8, 0xc9, 0xa8, 0xb6, 0x83, 0xd2, 0xa9, 0xab, 0xbf, 0xf7, 0x3e, 0xbf,
......
...@@ -40,7 +40,7 @@ type Release struct { ...@@ -40,7 +40,7 @@ type Release struct {
func (m *Release) Reset() { *m = Release{} } func (m *Release) Reset() { *m = Release{} }
func (m *Release) String() string { return proto.CompactTextString(m) } func (m *Release) String() string { return proto.CompactTextString(m) }
func (*Release) ProtoMessage() {} func (*Release) ProtoMessage() {}
func (*Release) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } func (*Release) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (m *Release) GetName() string { func (m *Release) GetName() string {
if m != nil { if m != nil {
...@@ -102,11 +102,11 @@ func init() { ...@@ -102,11 +102,11 @@ func init() {
proto.RegisterType((*Release)(nil), "hapi.release.Release") proto.RegisterType((*Release)(nil), "hapi.release.Release")
} }
func init() { proto.RegisterFile("hapi/release/release.proto", fileDescriptor3) } func init() { proto.RegisterFile("hapi/release/release.proto", fileDescriptor2) }
var fileDescriptor3 = []byte{ var fileDescriptor2 = []byte{
// 256 bytes of a gzipped FileDescriptorProto // 256 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x90, 0xbf, 0x4e, 0xc3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xbf, 0x4e, 0xc3, 0x40,
0x0c, 0xc6, 0x95, 0x36, 0x7f, 0x1a, 0xc3, 0x82, 0x07, 0xb0, 0x22, 0x86, 0x88, 0x01, 0x22, 0x86, 0x0c, 0xc6, 0x95, 0x36, 0x7f, 0x1a, 0xc3, 0x82, 0x07, 0xb0, 0x22, 0x86, 0x88, 0x01, 0x22, 0x86,
0x54, 0x82, 0x37, 0x80, 0x05, 0xd6, 0x1b, 0xd9, 0x8e, 0xe8, 0x42, 0x4e, 0xa5, 0xe7, 0x28, 0x17, 0x54, 0x82, 0x37, 0x80, 0x05, 0xd6, 0x1b, 0xd9, 0x8e, 0xe8, 0x42, 0x4e, 0xa5, 0xe7, 0x28, 0x17,
0xf1, 0x2c, 0x3c, 0x2e, 0xba, 0x3f, 0x85, 0x94, 0x2e, 0x4e, 0xec, 0xdf, 0xa7, 0xcf, 0xdf, 0x19, 0xf1, 0x2c, 0x3c, 0x2e, 0xba, 0x3f, 0x85, 0x94, 0x2e, 0x4e, 0xec, 0xdf, 0xa7, 0xcf, 0xdf, 0x19,
......
...@@ -51,7 +51,7 @@ var Status_Code_value = map[string]int32{ ...@@ -51,7 +51,7 @@ var Status_Code_value = map[string]int32{
func (x Status_Code) String() string { func (x Status_Code) String() string {
return proto.EnumName(Status_Code_name, int32(x)) return proto.EnumName(Status_Code_name, int32(x))
} }
func (Status_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0, 0} } func (Status_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} }
// Status defines the status of a release. // Status defines the status of a release.
type Status struct { type Status struct {
...@@ -67,7 +67,7 @@ type Status struct { ...@@ -67,7 +67,7 @@ type Status struct {
func (m *Status) Reset() { *m = Status{} } func (m *Status) Reset() { *m = Status{} }
func (m *Status) String() string { return proto.CompactTextString(m) } func (m *Status) String() string { return proto.CompactTextString(m) }
func (*Status) ProtoMessage() {} func (*Status) ProtoMessage() {}
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (m *Status) GetCode() Status_Code { func (m *Status) GetCode() Status_Code {
if m != nil { if m != nil {
...@@ -102,11 +102,11 @@ func init() { ...@@ -102,11 +102,11 @@ func init() {
proto.RegisterEnum("hapi.release.Status_Code", Status_Code_name, Status_Code_value) proto.RegisterEnum("hapi.release.Status_Code", Status_Code_name, Status_Code_value)
} }
func init() { proto.RegisterFile("hapi/release/status.proto", fileDescriptor4) } func init() { proto.RegisterFile("hapi/release/status.proto", fileDescriptor3) }
var fileDescriptor4 = []byte{ var fileDescriptor3 = []byte{
// 291 bytes of a gzipped FileDescriptorProto // 291 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x54, 0x90, 0xdf, 0x6a, 0xc2, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xdf, 0x6a, 0xc2, 0x30,
0x14, 0xc6, 0x57, 0xad, 0x3a, 0x8f, 0x22, 0x21, 0x1b, 0xac, 0xca, 0x06, 0xc5, 0xab, 0xde, 0xac, 0x14, 0xc6, 0x57, 0xad, 0x3a, 0x8f, 0x22, 0x21, 0x1b, 0xac, 0xca, 0x06, 0xc5, 0xab, 0xde, 0xac,
0x05, 0xf7, 0x04, 0xdb, 0x12, 0x87, 0xac, 0x54, 0x69, 0x2b, 0xfb, 0x73, 0x53, 0xaa, 0x9e, 0x39, 0x05, 0xf7, 0x04, 0xdb, 0x12, 0x87, 0xac, 0x54, 0x69, 0x2b, 0xfb, 0x73, 0x53, 0xaa, 0x9e, 0x39,
0xa1, 0x34, 0xd2, 0x24, 0x17, 0x7b, 0x88, 0xbd, 0xf3, 0x68, 0x2b, 0x74, 0x5e, 0x7e, 0xf9, 0xfd, 0xa1, 0x34, 0xd2, 0x24, 0x17, 0x7b, 0x88, 0xbd, 0xf3, 0x68, 0x2b, 0x74, 0x5e, 0x7e, 0xf9, 0xfd,
......
...@@ -36,7 +36,7 @@ var TestRun_Status_value = map[string]int32{ ...@@ -36,7 +36,7 @@ var TestRun_Status_value = map[string]int32{
func (x TestRun_Status) String() string { func (x TestRun_Status) String() string {
return proto.EnumName(TestRun_Status_name, int32(x)) return proto.EnumName(TestRun_Status_name, int32(x))
} }
func (TestRun_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 0} } func (TestRun_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0, 0} }
type TestRun struct { type TestRun struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
...@@ -49,7 +49,7 @@ type TestRun struct { ...@@ -49,7 +49,7 @@ type TestRun struct {
func (m *TestRun) Reset() { *m = TestRun{} } func (m *TestRun) Reset() { *m = TestRun{} }
func (m *TestRun) String() string { return proto.CompactTextString(m) } func (m *TestRun) String() string { return proto.CompactTextString(m) }
func (*TestRun) ProtoMessage() {} func (*TestRun) ProtoMessage() {}
func (*TestRun) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } func (*TestRun) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (m *TestRun) GetName() string { func (m *TestRun) GetName() string {
if m != nil { if m != nil {
...@@ -91,11 +91,11 @@ func init() { ...@@ -91,11 +91,11 @@ func init() {
proto.RegisterEnum("hapi.release.TestRun_Status", TestRun_Status_name, TestRun_Status_value) proto.RegisterEnum("hapi.release.TestRun_Status", TestRun_Status_name, TestRun_Status_value)
} }
func init() { proto.RegisterFile("hapi/release/test_run.proto", fileDescriptor5) } func init() { proto.RegisterFile("hapi/release/test_run.proto", fileDescriptor4) }
var fileDescriptor5 = []byte{ var fileDescriptor4 = []byte{
// 265 bytes of a gzipped FileDescriptorProto // 265 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x8f, 0x41, 0x4b, 0xfb, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0x41, 0x4b, 0xfb, 0x40,
0x14, 0xc4, 0xff, 0xc9, 0xbf, 0x26, 0x64, 0x53, 0x24, 0xec, 0x29, 0x54, 0xc1, 0xd0, 0x53, 0x4e, 0x14, 0xc4, 0xff, 0xc9, 0xbf, 0x26, 0x64, 0x53, 0x24, 0xec, 0x29, 0x54, 0xc1, 0xd0, 0x53, 0x4e,
0xbb, 0x50, 0xbd, 0x78, 0xf0, 0x10, 0x4b, 0x05, 0x51, 0x22, 0x6c, 0x1a, 0x04, 0x2f, 0x65, 0xab, 0xbb, 0x50, 0xbd, 0x78, 0xf0, 0x10, 0x4b, 0x05, 0x51, 0x22, 0x6c, 0x1a, 0x04, 0x2f, 0x65, 0xab,
0xaf, 0x35, 0x90, 0x64, 0x43, 0xf6, 0xe5, 0x8b, 0xf8, 0x89, 0x65, 0x93, 0xad, 0x78, 0xf3, 0xf6, 0xaf, 0x35, 0x90, 0x64, 0x43, 0xf6, 0xe5, 0x8b, 0xf8, 0x89, 0x65, 0x93, 0xad, 0x78, 0xf3, 0xf6,
......
...@@ -27,7 +27,7 @@ type TestSuite struct { ...@@ -27,7 +27,7 @@ type TestSuite struct {
func (m *TestSuite) Reset() { *m = TestSuite{} } func (m *TestSuite) Reset() { *m = TestSuite{} }
func (m *TestSuite) String() string { return proto.CompactTextString(m) } func (m *TestSuite) String() string { return proto.CompactTextString(m) }
func (*TestSuite) ProtoMessage() {} func (*TestSuite) ProtoMessage() {}
func (*TestSuite) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } func (*TestSuite) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
func (m *TestSuite) GetStartedAt() *google_protobuf.Timestamp { func (m *TestSuite) GetStartedAt() *google_protobuf.Timestamp {
if m != nil { if m != nil {
...@@ -54,11 +54,11 @@ func init() { ...@@ -54,11 +54,11 @@ func init() {
proto.RegisterType((*TestSuite)(nil), "hapi.release.TestSuite") proto.RegisterType((*TestSuite)(nil), "hapi.release.TestSuite")
} }
func init() { proto.RegisterFile("hapi/release/test_suite.proto", fileDescriptor6) } func init() { proto.RegisterFile("hapi/release/test_suite.proto", fileDescriptor5) }
var fileDescriptor6 = []byte{ var fileDescriptor5 = []byte{
// 207 bytes of a gzipped FileDescriptorProto // 207 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x8f, 0xc1, 0x4a, 0x86, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0xc1, 0x4a, 0x86, 0x40,
0x14, 0x85, 0x31, 0x21, 0x71, 0x74, 0x35, 0x10, 0x88, 0x11, 0x49, 0x2b, 0x57, 0x33, 0x60, 0xab, 0x14, 0x85, 0x31, 0x21, 0x71, 0x74, 0x35, 0x10, 0x88, 0x11, 0x49, 0x2b, 0x57, 0x33, 0x60, 0xab,
0x16, 0x2d, 0xec, 0x11, 0xcc, 0x55, 0x1b, 0x19, 0xeb, 0x66, 0xc2, 0xe8, 0x0c, 0x73, 0xef, 0xbc, 0x16, 0x2d, 0xec, 0x11, 0xcc, 0x55, 0x1b, 0x19, 0xeb, 0x66, 0xc2, 0xe8, 0x0c, 0x73, 0xef, 0xbc,
0x5a, 0xcf, 0x17, 0xea, 0x18, 0x41, 0x8b, 0x7f, 0xfd, 0x7d, 0xe7, 0x9c, 0x7b, 0xd9, 0xdd, 0x97, 0x5a, 0xcf, 0x17, 0xea, 0x18, 0x41, 0x8b, 0x7f, 0xfd, 0x7d, 0xe7, 0x9c, 0x7b, 0xd9, 0xdd, 0x97,
......
...@@ -1342,6 +1342,7 @@ var _ReleaseService_serviceDesc = grpc.ServiceDesc{ ...@@ -1342,6 +1342,7 @@ var _ReleaseService_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("hapi/services/tiller.proto", fileDescriptor0) } func init() { proto.RegisterFile("hapi/services/tiller.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
<<<<<<< b2afe5ec3cb08ec6ff5ca4200bd954d33154c948
// 1170 bytes of a gzipped FileDescriptorProto // 1170 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdb, 0x6e, 0xe3, 0x44, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdb, 0x6e, 0xe3, 0x44,
0x18, 0xae, 0xe3, 0x1c, 0xff, 0x1e, 0x48, 0xa7, 0x27, 0xd7, 0x02, 0x54, 0x8c, 0xa0, 0xd9, 0x85, 0x18, 0xae, 0xe3, 0x1c, 0xff, 0x1e, 0x48, 0xa7, 0x27, 0xd7, 0x02, 0x54, 0x8c, 0xa0, 0xd9, 0x85,
......
...@@ -69,7 +69,7 @@ func init() { proto.RegisterFile("hapi/version/version.proto", fileDescriptor0) ...@@ -69,7 +69,7 @@ func init() { proto.RegisterFile("hapi/version/version.proto", fileDescriptor0)
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
// 151 bytes of a gzipped FileDescriptorProto // 151 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x48, 0x2c, 0xc8, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x48, 0x2c, 0xc8,
0xd4, 0x2f, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x83, 0xd1, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0xd4, 0x2f, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x83, 0xd1, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9,
0x42, 0x3c, 0x20, 0x39, 0x3d, 0xa8, 0x98, 0x52, 0x3a, 0x17, 0x7b, 0x18, 0x84, 0x29, 0x24, 0xce, 0x42, 0x3c, 0x20, 0x39, 0x3d, 0xa8, 0x98, 0x52, 0x3a, 0x17, 0x7b, 0x18, 0x84, 0x29, 0x24, 0xce,
0xc5, 0x5e, 0x9c, 0x9a, 0x1b, 0x5f, 0x96, 0x5a, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0xc4, 0xc5, 0x5e, 0x9c, 0x9a, 0x1b, 0x5f, 0x96, 0x5a, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0xc4,
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
"k8s.io/helm/pkg/proto/hapi/release" rudderAPI "k8s.io/helm/pkg/proto/hapi/rudder"
) )
// GrpcPort specifies port on which rudder will spawn a server // GrpcPort specifies port on which rudder will spawn a server
...@@ -33,7 +33,7 @@ const ( ...@@ -33,7 +33,7 @@ const (
var grpcAddr = fmt.Sprintf("127.0.0.1:%d", GrpcPort) var grpcAddr = fmt.Sprintf("127.0.0.1:%d", GrpcPort)
// InstallRelease calls Rudder InstallRelease method which should create provided release // InstallRelease calls Rudder InstallRelease method which should create provided release
func InstallRelease(rel *release.InstallReleaseRequest) (*release.InstallReleaseResponse, error) { func InstallRelease(rel *rudderAPI.InstallReleaseRequest) (*rudderAPI.InstallReleaseResponse, error) {
//TODO(mkwiek): parametrize this //TODO(mkwiek): parametrize this
conn, err := grpc.Dial(grpcAddr, grpc.WithInsecure()) conn, err := grpc.Dial(grpcAddr, grpc.WithInsecure())
if err != nil { if err != nil {
...@@ -41,28 +41,28 @@ func InstallRelease(rel *release.InstallReleaseRequest) (*release.InstallRelease ...@@ -41,28 +41,28 @@ func InstallRelease(rel *release.InstallReleaseRequest) (*release.InstallRelease
} }
defer conn.Close() defer conn.Close()
client := release.NewReleaseModuleServiceClient(conn) client := rudderAPI.NewReleaseModuleServiceClient(conn)
return client.InstallRelease(context.Background(), rel) return client.InstallRelease(context.Background(), rel)
} }
// UpgradeRelease calls Rudder UpgradeRelease method which should perform update // UpgradeRelease calls Rudder UpgradeRelease method which should perform update
func UpgradeRelease(req *release.UpgradeReleaseRequest) (*release.UpgradeReleaseResponse, error) { func UpgradeRelease(req *rudderAPI.UpgradeReleaseRequest) (*rudderAPI.UpgradeReleaseResponse, error) {
conn, err := grpc.Dial(grpcAddr, grpc.WithInsecure()) conn, err := grpc.Dial(grpcAddr, grpc.WithInsecure())
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer conn.Close() defer conn.Close()
client := release.NewReleaseModuleServiceClient(conn) client := rudderAPI.NewReleaseModuleServiceClient(conn)
return client.UpgradeRelease(context.Background(), req) return client.UpgradeRelease(context.Background(), req)
} }
// RollbackRelease calls Rudder RollbackRelease method which should perform update // RollbackRelease calls Rudder RollbackRelease method which should perform update
func RollbackRelease(req *release.RollbackReleaseRequest) (*release.RollbackReleaseResponse, error) { func RollbackRelease(req *rudderAPI.RollbackReleaseRequest) (*rudderAPI.RollbackReleaseResponse, error) {
conn, err := grpc.Dial(grpcAddr, grpc.WithInsecure()) conn, err := grpc.Dial(grpcAddr, grpc.WithInsecure())
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer conn.Close() defer conn.Close()
client := release.NewReleaseModuleServiceClient(conn) client := rudderAPI.NewReleaseModuleServiceClient(conn)
return client.RollbackRelease(context.Background(), req) return client.RollbackRelease(context.Background(), req)
} }
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
"bytes" "bytes"
"k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/release"
rudderAPI "k8s.io/helm/pkg/proto/hapi/rudder"
"k8s.io/helm/pkg/proto/hapi/services" "k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/rudder" "k8s.io/helm/pkg/rudder"
"k8s.io/helm/pkg/tiller/environment" "k8s.io/helm/pkg/tiller/environment"
...@@ -58,14 +59,14 @@ type RemoteReleaseModule struct{} ...@@ -58,14 +59,14 @@ type RemoteReleaseModule struct{}
// Create calls rudder.InstallRelease // Create calls rudder.InstallRelease
func (m *RemoteReleaseModule) Create(r *release.Release, req *services.InstallReleaseRequest, env *environment.Environment) error { func (m *RemoteReleaseModule) Create(r *release.Release, req *services.InstallReleaseRequest, env *environment.Environment) error {
request := &release.InstallReleaseRequest{Release: r} request := &rudderAPI.InstallReleaseRequest{Release: r}
_, err := rudder.InstallRelease(request) _, err := rudder.InstallRelease(request)
return err return err
} }
// Update calls rudder.UpgradeRelease // Update calls rudder.UpgradeRelease
func (m *RemoteReleaseModule) Update(current, target *release.Release, req *services.UpdateReleaseRequest, env *environment.Environment) error { func (m *RemoteReleaseModule) Update(current, target *release.Release, req *services.UpdateReleaseRequest, env *environment.Environment) error {
upgrade := &release.UpgradeReleaseRequest{ upgrade := &rudderAPI.UpgradeReleaseRequest{
Current: current, Current: current,
Target: target, Target: target,
Recreate: req.Recreate, Recreate: req.Recreate,
...@@ -78,7 +79,7 @@ func (m *RemoteReleaseModule) Update(current, target *release.Release, req *serv ...@@ -78,7 +79,7 @@ func (m *RemoteReleaseModule) Update(current, target *release.Release, req *serv
// Rollback calls rudder.Rollback // Rollback calls rudder.Rollback
func (m *RemoteReleaseModule) Rollback(current, target *release.Release, req *services.RollbackReleaseRequest, env *environment.Environment) error { func (m *RemoteReleaseModule) Rollback(current, target *release.Release, req *services.RollbackReleaseRequest, env *environment.Environment) error {
rollback := &release.RollbackReleaseRequest{ rollback := &rudderAPI.RollbackReleaseRequest{
Current: current, Current: current,
Target: target, Target: target,
Recreate: req.Recreate, Recreate: req.Recreate,
......
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