Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2a538e31
Commit
2a538e31
authored
Feb 24, 2016
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving deployment deletion at the end
parent
9d725995
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
stop.go
pkg/kubectl/stop.go
+4
-6
stop_test.go
pkg/kubectl/stop_test.go
+4
-4
No files found.
pkg/kubectl/stop.go
View file @
2a538e31
...
...
@@ -382,11 +382,6 @@ func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Durati
return
err
}
// Delete deployment.
if
err
:=
deployments
.
Delete
(
name
,
gracePeriod
);
err
!=
nil
{
return
err
}
// Stop all replica sets.
selector
,
err
:=
unversioned
.
LabelSelectorAsSelector
(
deployment
.
Spec
.
Selector
)
if
err
!=
nil
{
...
...
@@ -409,7 +404,10 @@ func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Durati
if
len
(
errList
)
>
0
{
return
utilerrors
.
NewAggregate
(
errList
)
}
return
nil
// Delete deployment at the end.
// Note: We delete deployment at the end so that if removing RSs fails, we atleast have the deployment to retry.
return
deployments
.
Delete
(
name
,
gracePeriod
)
}
type
updateDeploymentFunc
func
(
d
*
extensions
.
Deployment
)
...
...
pkg/kubectl/stop_test.go
View file @
2a538e31
...
...
@@ -538,7 +538,7 @@ func TestDeploymentStop(t *testing.T) {
},
StopError
:
nil
,
ExpectedActions
:
[]
string
{
"get:deployments"
,
"update:deployments"
,
"get:deployments"
,
"
delete:deployments"
,
"list:replicase
ts"
},
"get:deployments"
,
"
list:replicasets"
,
"delete:deploymen
ts"
},
},
{
Name
:
"Deployment with single replicaset"
,
...
...
@@ -560,9 +560,9 @@ func TestDeploymentStop(t *testing.T) {
},
StopError
:
nil
,
ExpectedActions
:
[]
string
{
"get:deployments"
,
"update:deployments"
,
"get:deployments"
,
"
delete:deployments"
,
"lis
t:replicasets"
,
"get:replicasets"
,
"
get:replicasets"
,
"update
:replicasets"
,
"get:replicasets"
,
"
get:replicasets"
,
"delete:replicase
ts"
},
"get:deployments"
,
"
list:replicasets"
,
"ge
t:replicasets"
,
"get:replicasets"
,
"
update:replicasets"
,
"get
:replicasets"
,
"get:replicasets"
,
"
delete:replicasets"
,
"delete:deploymen
ts"
},
},
}
...
...
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