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
22c6b9b2
Commit
22c6b9b2
authored
Feb 04, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from adamreese/dm-uninstall
feat(dm-delete): add dm-delete command
parents
a3166a9c
1e37113c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
11 deletions
+84
-11
dm.go
cmd/helm/dm.go
+20
-9
doctor.go
cmd/helm/doctor.go
+0
-0
helm.go
cmd/helm/helm.go
+50
-2
uninstall.go
dm/uninstall.go
+14
-0
No files found.
cmd/helm/
install
.go
→
cmd/helm/
dm
.go
View file @
22c6b9b2
...
...
@@ -11,15 +11,8 @@ import (
var
ErrAlreadyInstalled
error
=
errors
.
New
(
"Already Installed"
)
func
install
(
dryRun
bool
)
error
{
var
runner
kubectl
.
Runner
if
dryRun
{
runner
=
&
kubectl
.
PrintRunner
{}
}
else
{
runner
=
&
kubectl
.
RealRunner
{}
if
dm
.
IsInstalled
(
runner
)
{
return
ErrAlreadyInstalled
}
}
runner
:=
getKubectlRunner
(
dryRun
)
out
,
err
:=
dm
.
Install
(
runner
)
if
err
!=
nil
{
format
.
Error
(
"Error installing: %s %s"
,
out
,
err
)
...
...
@@ -27,3 +20,21 @@ func install(dryRun bool) error {
format
.
Msg
(
out
)
return
nil
}
func
uninstall
(
dryRun
bool
)
error
{
runner
:=
getKubectlRunner
(
dryRun
)
out
,
err
:=
dm
.
Uninstall
(
runner
)
if
err
!=
nil
{
format
.
Error
(
"Error uninstalling: %s %s"
,
out
,
err
)
}
format
.
Msg
(
out
)
return
nil
}
func
getKubectlRunner
(
dryRun
bool
)
kubectl
.
Runner
{
if
dryRun
{
return
&
kubectl
.
PrintRunner
{}
}
return
&
kubectl
.
RealRunner
{}
}
cmd/doctor.go
→
cmd/
helm/
doctor.go
View file @
22c6b9b2
File moved
cmd/helm/helm.go
View file @
22c6b9b2
...
...
@@ -33,8 +33,12 @@ func main() {
func
commands
()
[]
cli
.
Command
{
return
[]
cli
.
Command
{
{
Name
:
"init"
,
Usage
:
"Initialize the client and install DM on Kubernetes."
,
Name
:
"dm"
,
Usage
:
"Manage DM on Kubernetes"
,
Subcommands
:
[]
cli
.
Command
{
{
Name
:
"install"
,
Usage
:
"Install DM on Kubernetes."
,
Description
:
``
,
Flags
:
[]
cli
.
Flag
{
cli
.
BoolFlag
{
...
...
@@ -49,6 +53,31 @@ func commands() []cli.Command {
}
},
},
{
Name
:
"uninstall"
,
Usage
:
"Uninstall the DM from Kubernetes."
,
Description
:
``
,
Flags
:
[]
cli
.
Flag
{
cli
.
BoolFlag
{
Name
:
"dry-run"
,
Usage
:
"Show what would be installed, but don't install anything."
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
if
err
:=
uninstall
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
format
.
Error
(
"%s (Run 'helm doctor' for more information)"
,
err
)
os
.
Exit
(
1
)
}
},
},
{
Name
:
"status"
,
Usage
:
"Show status of DM."
,
Action
:
func
(
c
*
cli
.
Context
)
{
format
.
Error
(
"Not yet implemented"
)
os
.
Exit
(
1
)
},
},
{
Name
:
"target"
,
Usage
:
"Displays information about cluster."
,
...
...
@@ -66,6 +95,25 @@ func commands() []cli.Command {
},
},
},
},
},
{
Name
:
"init"
,
Usage
:
"Initialize the client and install DM on Kubernetes."
,
Description
:
``
,
Flags
:
[]
cli
.
Flag
{
cli
.
BoolFlag
{
Name
:
"dry-run"
,
Usage
:
"Show what would be installed, but don't install anything."
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
if
err
:=
install
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
format
.
Error
(
"%s (Run 'helm doctor' for more information)"
,
err
)
os
.
Exit
(
1
)
}
},
},
{
Name
:
"doctor"
,
Usage
:
"Run a series of checks for necessary prerequisites."
,
...
...
dm/uninstall.go
0 → 100644
View file @
22c6b9b2
package
dm
import
(
"github.com/deis/helm-dm/kubectl"
)
// uninstall uses kubectl to uninstall the base DM.
//
// Returns the string output received from the operation, and an error if the
// command failed.
func
Uninstall
(
runner
kubectl
.
Runner
)
(
string
,
error
)
{
o
,
err
:=
runner
.
Delete
(
"dm"
,
"Namespace"
,
"dm"
)
return
string
(
o
),
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