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
64c7ab20
Commit
64c7ab20
authored
Mar 21, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(cli): Add 'helm deployment delete'
Closes #239
parent
37c27a97
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
57 deletions
+30
-57
delete.go
cmd/helm/delete.go
+0
-50
deployment.go
cmd/helm/deployment.go
+27
-4
start-local.sh
scripts/start-local.sh
+3
-3
No files found.
cmd/helm/delete.go
deleted
100644 → 0
View file @
37c27a97
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
main
import
(
"errors"
"github.com/codegangsta/cli"
"github.com/kubernetes/helm/pkg/format"
)
func
init
()
{
addCommands
(
deleteCmd
())
}
func
deleteCmd
()
cli
.
Command
{
return
cli
.
Command
{
Name
:
"delete"
,
Usage
:
"Deletes the supplied deployment"
,
ArgsUsage
:
"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
:=
NewClient
(
c
)
.
DeleteDeployment
(
name
)
if
err
!=
nil
{
return
err
}
return
format
.
YAML
(
deployment
)
}
cmd/helm/deployment.go
View file @
64c7ab20
...
...
@@ -40,6 +40,13 @@ func deploymentCommands() cli.Command {
Usage
:
"Dump the configuration file for this deployment."
,
ArgsUsage
:
"DEPLOYMENT"
,
},
{
Name
:
"delete"
,
Aliases
:
[]
string
{
"del"
},
Usage
:
"Deletes the named deployment(s)."
,
ArgsUsage
:
"DEPLOYMENT [DEPLOYMENT [...]]"
,
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
deleteDeployment
)
},
},
{
Name
:
"manifest"
,
Usage
:
"Dump the Kubernetes manifest file for this deployment."
,
...
...
@@ -53,15 +60,16 @@ func deploymentCommands() cli.Command {
},
{
Name
:
"list"
,
Usage
:
"list all deployments, or filter by an optional pattern"
,
ArgsUsage
:
"PATTERN"
,
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
list
)
},
Aliases
:
[]
string
{
"ls"
},
Usage
:
"list all deployments, or filter by an optional regular expression."
,
ArgsUsage
:
"REGEXP"
,
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
listDeployments
)
},
},
},
}
}
func
list
(
c
*
cli
.
Context
)
error
{
func
list
Deployments
(
c
*
cli
.
Context
)
error
{
list
,
err
:=
NewClient
(
c
)
.
ListDeployments
()
if
err
!=
nil
{
return
err
...
...
@@ -90,3 +98,18 @@ func list(c *cli.Context) error {
format
.
List
(
list
)
return
nil
}
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'"
)
}
for
_
,
name
:=
range
args
{
deployment
,
err
:=
NewClient
(
c
)
.
DeleteDeployment
(
name
)
if
err
!=
nil
{
return
err
}
format
.
Info
(
"Deleted %q at %s"
,
name
,
deployment
.
DeletedAt
)
}
return
nil
}
scripts/start-local.sh
View file @
64c7ab20
...
...
@@ -34,15 +34,15 @@ fi
KUBECTL
=
$(
which kubectl
)
||
error_exit
"Cannot find kubectl"
echo
"Starting resourcifier..."
pkill
-f
$RESOURCIFIER
#
pkill -f $RESOURCIFIER
nohup
$RESOURCIFIER
>
$LOGDIR
/resourcifier.log 2>&1
--kubectl
=
"
${
KUBECTL
}
"
--port
=
8082 &
echo
"Starting expandybird..."
pkill
-f
$EXPANDYBIRD
#
pkill -f $EXPANDYBIRD
nohup
$EXPANDYBIRD
>
$LOGDIR
/expandybird.log 2>&1
--port
=
8081
--expansion_binary
=
expansion/expansion.py &
echo
"Starting deployment manager..."
pkill
-f
$MANAGER
#
pkill -f $MANAGER
nohup
$MANAGER
>
$LOGDIR
/manager.log 2>&1
--port
=
"
${
MANAGER_PORT
}
"
--kubectl
=
"
${
KUBECTL
}
"
--expanderURL
=
http://localhost:8081
--deployerURL
=
http://localhost:8082 &
if
[[
"
$KUBE_PROXY
"
]]
;
then
...
...
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