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
3cba189f
Commit
3cba189f
authored
Mar 17, 2017
by
Dmitry Shulyak
Committed by
Maciej Kwiek
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define both rudder port and rudder address for different needs
parent
bd47b844
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
rudder.go
cmd/rudder/rudder.go
+1
-1
client.go
pkg/rudder/client.go
+11
-5
No files found.
cmd/rudder/rudder.go
View file @
3cba189f
...
@@ -34,7 +34,7 @@ import (
...
@@ -34,7 +34,7 @@ import (
var
kubeClient
=
kube
.
New
(
nil
)
var
kubeClient
=
kube
.
New
(
nil
)
func
main
()
{
func
main
()
{
lis
,
err
:=
net
.
Listen
(
"tcp"
,
fmt
.
Sprintf
(
":%d"
,
rudder
.
Grpc
Addr
))
lis
,
err
:=
net
.
Listen
(
"tcp"
,
fmt
.
Sprintf
(
":%d"
,
rudder
.
Grpc
Port
))
if
err
!=
nil
{
if
err
!=
nil
{
grpclog
.
Fatalf
(
"failed to listen: %v"
,
err
)
grpclog
.
Fatalf
(
"failed to listen: %v"
,
err
)
}
}
...
...
pkg/rudder/client.go
View file @
3cba189f
...
@@ -17,19 +17,25 @@ limitations under the License.
...
@@ -17,19 +17,25 @@ limitations under the License.
package
rudder
// import "k8s.io/helm/pkg/rudder"
package
rudder
// import "k8s.io/helm/pkg/rudder"
import
(
import
(
"fmt"
"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"
"k8s.io/helm/pkg/proto/hapi/release"
)
)
// GrpcAddr is an address that should be used to access Rudder service
// GrpcPort specifies port on which rudder will spawn a server
const
GrpcAddr
=
"127.0.0.1:10001"
const
(
GrpcPort
=
10001
)
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
*
release
.
InstallReleaseRequest
)
(
*
release
.
InstallReleaseResponse
,
error
)
{
//TODO(mkwiek): parametrize this
//TODO(mkwiek): parametrize this
conn
,
err
:=
grpc
.
Dial
(
G
rpcAddr
,
grpc
.
WithInsecure
())
conn
,
err
:=
grpc
.
Dial
(
g
rpcAddr
,
grpc
.
WithInsecure
())
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -41,7 +47,7 @@ func InstallRelease(rel *release.InstallReleaseRequest) (*release.InstallRelease
...
@@ -41,7 +47,7 @@ func InstallRelease(rel *release.InstallReleaseRequest) (*release.InstallRelease
// 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
*
release
.
UpgradeReleaseRequest
)
(
*
release
.
UpgradeReleaseResponse
,
error
)
{
conn
,
err
:=
grpc
.
Dial
(
G
rpcAddr
,
grpc
.
WithInsecure
())
conn
,
err
:=
grpc
.
Dial
(
g
rpcAddr
,
grpc
.
WithInsecure
())
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -52,7 +58,7 @@ func UpgradeRelease(req *release.UpgradeReleaseRequest) (*release.UpgradeRelease
...
@@ -52,7 +58,7 @@ func UpgradeRelease(req *release.UpgradeReleaseRequest) (*release.UpgradeRelease
// 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
*
release
.
RollbackReleaseRequest
)
(
*
release
.
RollbackReleaseResponse
,
error
)
{
conn
,
err
:=
grpc
.
Dial
(
G
rpcAddr
,
grpc
.
WithInsecure
())
conn
,
err
:=
grpc
.
Dial
(
g
rpcAddr
,
grpc
.
WithInsecure
())
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