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
14efdee0
Commit
14efdee0
authored
Mar 24, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cli): switched `server` actions to use `run()`
parent
084c0da5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
33 deletions
+18
-33
server.go
cmd/helm/server.go
+18
-33
No files found.
cmd/helm/server.go
View file @
14efdee0
...
@@ -19,7 +19,6 @@ package main
...
@@ -19,7 +19,6 @@ package main
import
(
import
(
"errors"
"errors"
"fmt"
"fmt"
"os"
"github.com/codegangsta/cli"
"github.com/codegangsta/cli"
"github.com/kubernetes/helm/pkg/client"
"github.com/kubernetes/helm/pkg/client"
...
@@ -68,16 +67,7 @@ func dmCmd() cli.Command {
...
@@ -68,16 +67,7 @@ func dmCmd() cli.Command {
EnvVar
:
"HELM_MANAGER_IMAGE"
,
EnvVar
:
"HELM_MANAGER_IMAGE"
,
},
},
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
installServer
)
},
dry
:=
c
.
Bool
(
"dry-run"
)
ri
:=
c
.
String
(
"resourcifier-image"
)
ei
:=
c
.
String
(
"expandybird-image"
)
mi
:=
c
.
String
(
"manager-image"
)
if
err
:=
install
(
dry
,
ei
,
mi
,
ri
);
err
!=
nil
{
format
.
Err
(
"%s (Run 'helm doctor' for more information)"
,
err
)
os
.
Exit
(
1
)
}
},
},
},
{
{
Name
:
"uninstall"
,
Name
:
"uninstall"
,
...
@@ -90,12 +80,7 @@ func dmCmd() cli.Command {
...
@@ -90,12 +80,7 @@ func dmCmd() cli.Command {
Usage
:
"Show what would be uninstalled, but don't remove anything."
,
Usage
:
"Show what would be uninstalled, but don't remove anything."
,
},
},
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
uninstallServer
)
},
if
err
:=
uninstall
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
format
.
Err
(
"%s (Run 'helm doctor' for more information)"
,
err
)
os
.
Exit
(
1
)
}
},
},
},
{
{
Name
:
"status"
,
Name
:
"status"
,
...
@@ -107,22 +92,13 @@ func dmCmd() cli.Command {
...
@@ -107,22 +92,13 @@ func dmCmd() cli.Command {
Usage
:
"Only display the underlying kubectl commands."
,
Usage
:
"Only display the underlying kubectl commands."
,
},
},
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
statusServer
)
},
if
err
:=
status
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
os
.
Exit
(
1
)
}
},
},
},
{
{
Name
:
"target"
,
Name
:
"target"
,
Usage
:
"Displays information about the Kubernetes cluster."
,
Usage
:
"Displays information about the Kubernetes cluster."
,
ArgsUsage
:
""
,
ArgsUsage
:
""
,
Action
:
func
(
c
*
cli
.
Context
)
{
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
targetServer
)
},
if
err
:=
target
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
format
.
Err
(
"%s (Is the cluster running?)"
,
err
)
os
.
Exit
(
1
)
}
},
Flags
:
[]
cli
.
Flag
{
Flags
:
[]
cli
.
Flag
{
cli
.
BoolFlag
{
cli
.
BoolFlag
{
Name
:
"dry-run"
,
Name
:
"dry-run"
,
...
@@ -134,7 +110,11 @@ func dmCmd() cli.Command {
...
@@ -134,7 +110,11 @@ func dmCmd() cli.Command {
}
}
}
}
func
install
(
dryRun
bool
,
ebImg
,
manImg
,
resImg
string
)
error
{
func
installServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
resImg
:=
c
.
String
(
"resourcifier-image"
)
ebImg
:=
c
.
String
(
"expandybird-image"
)
manImg
:=
c
.
String
(
"manager-image"
)
runner
:=
getKubectlRunner
(
dryRun
)
runner
:=
getKubectlRunner
(
dryRun
)
i
:=
client
.
NewInstaller
()
i
:=
client
.
NewInstaller
()
...
@@ -146,11 +126,14 @@ func install(dryRun bool, ebImg, manImg, resImg string) error {
...
@@ -146,11 +126,14 @@ func install(dryRun bool, ebImg, manImg, resImg string) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
format
.
Msg
(
out
)
if
debug
{
format
.
Msg
(
out
)
}
return
nil
return
nil
}
}
func
uninstall
(
dryRun
bool
)
error
{
func
uninstallServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
runner
:=
getKubectlRunner
(
dryRun
)
runner
:=
getKubectlRunner
(
dryRun
)
out
,
err
:=
client
.
Uninstall
(
runner
)
out
,
err
:=
client
.
Uninstall
(
runner
)
...
@@ -161,7 +144,8 @@ func uninstall(dryRun bool) error {
...
@@ -161,7 +144,8 @@ func uninstall(dryRun bool) error {
return
nil
return
nil
}
}
func
status
(
dryRun
bool
)
error
{
func
statusServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
client
:=
kubectl
.
Client
client
:=
kubectl
.
Client
if
dryRun
{
if
dryRun
{
client
=
kubectl
.
PrintRunner
{}
client
=
kubectl
.
PrintRunner
{}
...
@@ -182,7 +166,8 @@ func getKubectlRunner(dryRun bool) kubectl.Runner {
...
@@ -182,7 +166,8 @@ func getKubectlRunner(dryRun bool) kubectl.Runner {
return
&
kubectl
.
RealRunner
{}
return
&
kubectl
.
RealRunner
{}
}
}
func
target
(
dryRun
bool
)
error
{
func
targetServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
client
:=
kubectl
.
Client
client
:=
kubectl
.
Client
if
dryRun
{
if
dryRun
{
client
=
kubectl
.
PrintRunner
{}
client
=
kubectl
.
PrintRunner
{}
...
...
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