Commit d9f72deb authored by Maciej Kwiek's avatar Maciej Kwiek

Add comments to exported Rudder methods

Added make target
Lowered docker image sizes
Updated ruder.pb.go
parent 1c9ae557
...@@ -61,15 +61,20 @@ docker-binary: BINDIR = ./rootfs ...@@ -61,15 +61,20 @@ docker-binary: BINDIR = ./rootfs
docker-binary: GOFLAGS += -a -installsuffix cgo docker-binary: GOFLAGS += -a -installsuffix cgo
docker-binary: docker-binary:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/rudder $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/rudder
.PHONY: docker-build .PHONY: docker-build
docker-build: check-docker docker-binary docker-build: check-docker docker-binary
docker build --rm -t ${IMAGE} rootfs docker build --rm -t ${IMAGE} rootfs
docker tag ${IMAGE} ${MUTABLE_IMAGE} docker tag ${IMAGE} ${MUTABLE_IMAGE}
.PHONY: docker-binary-rudder
docker-binary-rudder: BINDIR = ./rootfs
docker-binary-rudder: GOFLAGS += -a -installsuffix cgo
docker-binary-rudder:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/rudder $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/rudder
.PHONY: docker-build-experimental .PHONY: docker-build-experimental
docker-build-experimental: check-docker docker-binary docker-build-experimental: check-docker docker-binary docker-binary-rudder
docker build --rm -t ${IMAGE} rootfs -f rootfs/Dockerfile.experimental docker build --rm -t ${IMAGE} rootfs -f rootfs/Dockerfile.experimental
docker tag ${IMAGE} ${MUTABLE_IMAGE} docker tag ${IMAGE} ${MUTABLE_IMAGE}
docker build --rm -t ${IMAGE_RUDDER} rootfs -f rootfs/Dockerfile.rudder docker build --rm -t ${IMAGE_RUDDER} rootfs -f rootfs/Dockerfile.rudder
......
...@@ -59,7 +59,7 @@ func main() { ...@@ -59,7 +59,7 @@ func main() {
// ReleaseModuleServiceServer provides implementation for rudderAPI.ReleaseModuleServiceServer // ReleaseModuleServiceServer provides implementation for rudderAPI.ReleaseModuleServiceServer
type ReleaseModuleServiceServer struct{} type ReleaseModuleServiceServer struct{}
// Version is not yet implemented // Version returns Rudder version based on helm version
func (r *ReleaseModuleServiceServer) Version(ctx context.Context, in *rudderAPI.VersionReleaseRequest) (*rudderAPI.VersionReleaseResponse, error) { func (r *ReleaseModuleServiceServer) Version(ctx context.Context, in *rudderAPI.VersionReleaseRequest) (*rudderAPI.VersionReleaseResponse, error) {
grpclog.Print("version") grpclog.Print("version")
return &rudderAPI.VersionReleaseResponse{ return &rudderAPI.VersionReleaseResponse{
...@@ -100,8 +100,6 @@ func (r *ReleaseModuleServiceServer) DeleteRelease(ctx context.Context, in *rudd ...@@ -100,8 +100,6 @@ func (r *ReleaseModuleServiceServer) DeleteRelease(ctx context.Context, in *rudd
if len(allErrors) > 0 { if len(allErrors) > 0 {
err = fmt.Errorf(allErrors) err = fmt.Errorf(allErrors)
} else {
err = nil
} }
return &rudderAPI.DeleteReleaseResponse{ return &rudderAPI.DeleteReleaseResponse{
......
...@@ -88,6 +88,20 @@ func (m *Result) String() string { return proto.CompactTextString(m) ...@@ -88,6 +88,20 @@ func (m *Result) String() string { return proto.CompactTextString(m)
func (*Result) ProtoMessage() {} func (*Result) ProtoMessage() {}
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Result) GetInfo() string {
if m != nil {
return m.Info
}
return ""
}
func (m *Result) GetLog() []string {
if m != nil {
return m.Log
}
return nil
}
type VersionReleaseRequest struct { type VersionReleaseRequest struct {
} }
...@@ -106,6 +120,20 @@ func (m *VersionReleaseResponse) String() string { return proto.Compa ...@@ -106,6 +120,20 @@ func (m *VersionReleaseResponse) String() string { return proto.Compa
func (*VersionReleaseResponse) ProtoMessage() {} func (*VersionReleaseResponse) ProtoMessage() {}
func (*VersionReleaseResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (*VersionReleaseResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *VersionReleaseResponse) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *VersionReleaseResponse) GetVersion() string {
if m != nil {
return m.Version
}
return ""
}
type InstallReleaseRequest struct { type InstallReleaseRequest struct {
Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"` Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"`
} }
...@@ -213,6 +241,27 @@ func (m *UpgradeReleaseRequest) GetTarget() *hapi_release5.Release { ...@@ -213,6 +241,27 @@ func (m *UpgradeReleaseRequest) GetTarget() *hapi_release5.Release {
return nil return nil
} }
func (m *UpgradeReleaseRequest) GetTimeout() int64 {
if m != nil {
return m.Timeout
}
return 0
}
func (m *UpgradeReleaseRequest) GetWait() bool {
if m != nil {
return m.Wait
}
return false
}
func (m *UpgradeReleaseRequest) GetRecreate() bool {
if m != nil {
return m.Recreate
}
return false
}
type UpgradeReleaseResponse struct { type UpgradeReleaseResponse struct {
Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"` Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"`
Result *Result `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"` Result *Result `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"`
...@@ -264,6 +313,27 @@ func (m *RollbackReleaseRequest) GetTarget() *hapi_release5.Release { ...@@ -264,6 +313,27 @@ func (m *RollbackReleaseRequest) GetTarget() *hapi_release5.Release {
return nil return nil
} }
func (m *RollbackReleaseRequest) GetTimeout() int64 {
if m != nil {
return m.Timeout
}
return 0
}
func (m *RollbackReleaseRequest) GetWait() bool {
if m != nil {
return m.Wait
}
return false
}
func (m *RollbackReleaseRequest) GetRecreate() bool {
if m != nil {
return m.Recreate
}
return false
}
type RollbackReleaseResponse struct { type RollbackReleaseResponse struct {
Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"` Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"`
Result *Result `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"` Result *Result `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"`
...@@ -351,7 +421,7 @@ var _ grpc.ClientConn ...@@ -351,7 +421,7 @@ var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion3 const _ = grpc.SupportPackageIsVersion4
// Client API for ReleaseModuleService service // Client API for ReleaseModuleService service
...@@ -589,14 +659,14 @@ var _ReleaseModuleService_serviceDesc = grpc.ServiceDesc{ ...@@ -589,14 +659,14 @@ var _ReleaseModuleService_serviceDesc = grpc.ServiceDesc{
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: fileDescriptor0, Metadata: "hapi/rudder/rudder.proto",
} }
func init() { proto.RegisterFile("hapi/rudder/rudder.proto", fileDescriptor0) } func init() { proto.RegisterFile("hapi/rudder/rudder.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
// 584 bytes of a gzipped FileDescriptorProto // 584 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xd1, 0x8e, 0xd2, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x56, 0xd1, 0x8e, 0xd2, 0x40,
0x14, 0xa5, 0xcb, 0x52, 0xe0, 0x92, 0x55, 0x32, 0xd9, 0x42, 0xd3, 0xf8, 0x40, 0xfa, 0x60, 0x88, 0x14, 0xa5, 0xcb, 0x52, 0xe0, 0x92, 0x55, 0x32, 0xd9, 0x42, 0xd3, 0xf8, 0x40, 0xfa, 0x60, 0x88,
0xeb, 0x96, 0x04, 0x7d, 0xf4, 0x45, 0x59, 0xdc, 0xdd, 0x18, 0xd9, 0x64, 0x2a, 0x6e, 0xe2, 0x5b, 0xeb, 0x96, 0x04, 0x7d, 0xf4, 0x45, 0x59, 0xdc, 0xdd, 0x18, 0xd9, 0x64, 0x2a, 0x6e, 0xe2, 0x5b,
0x17, 0x2e, 0x58, 0x2d, 0x6d, 0x9d, 0x4e, 0xf7, 0x51, 0xfd, 0x1a, 0xff, 0x43, 0xbf, 0xcc, 0xb4, 0x17, 0x2e, 0x58, 0x2d, 0x6d, 0x9d, 0x4e, 0xf7, 0x51, 0xfd, 0x1a, 0xff, 0x43, 0xbf, 0xcc, 0xb4,
......
...@@ -55,18 +55,21 @@ func (m *LocalReleaseModule) Create(r *release.Release, req *services.InstallRel ...@@ -55,18 +55,21 @@ func (m *LocalReleaseModule) Create(r *release.Release, req *services.InstallRel
return env.KubeClient.Create(r.Namespace, b, req.Timeout, req.Wait) return env.KubeClient.Create(r.Namespace, b, req.Timeout, req.Wait)
} }
// Update performs an update from current to target release
func (m *LocalReleaseModule) Update(current, target *release.Release, req *services.UpdateReleaseRequest, env *environment.Environment) error { func (m *LocalReleaseModule) Update(current, target *release.Release, req *services.UpdateReleaseRequest, env *environment.Environment) error {
c := bytes.NewBufferString(current.Manifest) c := bytes.NewBufferString(current.Manifest)
t := bytes.NewBufferString(target.Manifest) t := bytes.NewBufferString(target.Manifest)
return env.KubeClient.Update(target.Namespace, c, t, req.Recreate, req.Timeout, req.Wait) return env.KubeClient.Update(target.Namespace, c, t, req.Recreate, req.Timeout, req.Wait)
} }
// Rollback performs a rollback from current to target release
func (m *LocalReleaseModule) Rollback(current, target *release.Release, req *services.RollbackReleaseRequest, env *environment.Environment) error { func (m *LocalReleaseModule) Rollback(current, target *release.Release, req *services.RollbackReleaseRequest, env *environment.Environment) error {
c := bytes.NewBufferString(current.Manifest) c := bytes.NewBufferString(current.Manifest)
t := bytes.NewBufferString(target.Manifest) t := bytes.NewBufferString(target.Manifest)
return env.KubeClient.Update(target.Namespace, c, t, req.Recreate, req.Timeout, req.Wait) return env.KubeClient.Update(target.Namespace, c, t, req.Recreate, req.Timeout, req.Wait)
} }
// Status returns kubectl-like formatted status of release objects
func (m *LocalReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) { func (m *LocalReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) {
return env.KubeClient.Get(r.Namespace, bytes.NewBufferString(r.Manifest)) return env.KubeClient.Get(r.Namespace, bytes.NewBufferString(r.Manifest))
} }
...@@ -116,6 +119,7 @@ func (m *RemoteReleaseModule) Rollback(current, target *release.Release, req *se ...@@ -116,6 +119,7 @@ func (m *RemoteReleaseModule) Rollback(current, target *release.Release, req *se
return err return err
} }
// Status returns status retrieved from rudder.ReleaseStatus
func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) { func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) {
statusRequest := &rudderAPI.ReleaseStatusRequest{Release: r} statusRequest := &rudderAPI.ReleaseStatusRequest{Release: r}
resp, err := rudder.ReleaseStatus(statusRequest) resp, err := rudder.ReleaseStatus(statusRequest)
......
...@@ -16,7 +16,7 @@ FROM alpine:3.3 ...@@ -16,7 +16,7 @@ FROM alpine:3.3
ENV HOME /tmp ENV HOME /tmp
COPY . / COPY tiller /tiller
EXPOSE 44134 EXPOSE 44134
......
...@@ -16,7 +16,7 @@ FROM alpine:3.3 ...@@ -16,7 +16,7 @@ FROM alpine:3.3
ENV HOME /tmp ENV HOME /tmp
COPY . / COPY rudder /rudder
EXPOSE 10001 EXPOSE 10001
......
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