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
ec4e9f30
Commit
ec4e9f30
authored
Feb 10, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19 from adamreese/feat/delete
feat(delete): add delete verb
parents
08aed00f
dbd90b5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
delete.go
cmd/helm/delete.go
+33
-0
client.go
dm/client.go
+9
-0
No files found.
cmd/helm/delete.go
0 → 100644
View file @
ec4e9f30
package
main
import
(
"errors"
"github.com/codegangsta/cli"
"github.com/deis/helm-dm/format"
)
func
init
()
{
addCommands
(
deleteCmd
())
}
func
deleteCmd
()
cli
.
Command
{
return
cli
.
Command
{
Name
:
"delete"
,
Usage
:
"Deletes the supplied deployment"
,
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
deleteDeployment
)
},
}
}
func
deleteDeployment
(
c
*
cli
.
Context
)
error
{
args
:=
c
.
Args
()
if
len
(
args
)
<
1
{
return
errors
.
New
(
"First argument, deployment name, is required. Try 'helm get --help'"
)
}
name
:=
args
[
0
]
deployment
,
err
:=
client
(
c
)
.
DeleteDeployment
(
name
)
if
err
!=
nil
{
return
err
}
return
format
.
YAML
(
deployment
)
}
dm/client.go
View file @
ec4e9f30
...
...
@@ -224,3 +224,12 @@ func (c *Client) GetDeployment(name string) (*common.Deployment, error) {
}
return
deployment
,
nil
}
// DeleteDeployment deletes the supplied deployment
func
(
c
*
Client
)
DeleteDeployment
(
name
string
)
(
*
common
.
Deployment
,
error
)
{
var
deployment
*
common
.
Deployment
if
err
:=
c
.
CallService
(
filepath
.
Join
(
"deployments"
,
name
),
"DELETE"
,
"delete deployment"
,
&
deployment
,
nil
);
err
!=
nil
{
return
nil
,
err
}
return
deployment
,
nil
}
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