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
ff83eb58
Commit
ff83eb58
authored
Feb 09, 2017
by
Michail Kargakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more logs during the cleanup phase of a deployment
parent
d953402c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
sync.go
pkg/controller/deployment/sync.go
+2
-0
util.go
test/e2e/framework/util.go
+12
-2
No files found.
pkg/controller/deployment/sync.go
View file @
ff83eb58
...
@@ -547,6 +547,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
...
@@ -547,6 +547,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
}
}
sort
.
Sort
(
controller
.
ReplicaSetsByCreationTimestamp
(
oldRSs
))
sort
.
Sort
(
controller
.
ReplicaSetsByCreationTimestamp
(
oldRSs
))
glog
.
V
(
2
)
.
Infof
(
"Looking to cleanup old replica sets for deployment %q"
,
deployment
.
Name
)
var
errList
[]
error
var
errList
[]
error
// TODO: This should be parallelized.
// TODO: This should be parallelized.
...
@@ -556,6 +557,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
...
@@ -556,6 +557,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
if
rs
.
Status
.
Replicas
!=
0
||
*
(
rs
.
Spec
.
Replicas
)
!=
0
||
rs
.
Generation
>
rs
.
Status
.
ObservedGeneration
{
if
rs
.
Status
.
Replicas
!=
0
||
*
(
rs
.
Spec
.
Replicas
)
!=
0
||
rs
.
Generation
>
rs
.
Status
.
ObservedGeneration
{
continue
continue
}
}
glog
.
V
(
2
)
.
Infof
(
"Trying to cleanup replica set %q for deployment %q"
,
rs
.
Name
,
deployment
.
Name
)
if
err
:=
dc
.
client
.
Extensions
()
.
ReplicaSets
(
rs
.
Namespace
)
.
Delete
(
rs
.
Name
,
nil
);
err
!=
nil
&&
!
errors
.
IsNotFound
(
err
)
{
if
err
:=
dc
.
client
.
Extensions
()
.
ReplicaSets
(
rs
.
Namespace
)
.
Delete
(
rs
.
Name
,
nil
);
err
!=
nil
&&
!
errors
.
IsNotFound
(
err
)
{
glog
.
V
(
2
)
.
Infof
(
"Failed deleting old replica set %v for deployment %v: %v"
,
rs
.
Name
,
deployment
.
Name
,
err
)
glog
.
V
(
2
)
.
Infof
(
"Failed deleting old replica set %v for deployment %v: %v"
,
rs
.
Name
,
deployment
.
Name
,
err
)
errList
=
append
(
errList
,
err
)
errList
=
append
(
errList
,
err
)
...
...
test/e2e/framework/util.go
View file @
ff83eb58
...
@@ -3422,17 +3422,27 @@ func WaitForPodsReady(c clientset.Interface, ns, name string, minReadySeconds in
...
@@ -3422,17 +3422,27 @@ func WaitForPodsReady(c clientset.Interface, ns, name string, minReadySeconds in
// Waits for the deployment to clean up old rcs.
// Waits for the deployment to clean up old rcs.
func
WaitForDeploymentOldRSsNum
(
c
clientset
.
Interface
,
ns
,
deploymentName
string
,
desiredRSNum
int
)
error
{
func
WaitForDeploymentOldRSsNum
(
c
clientset
.
Interface
,
ns
,
deploymentName
string
,
desiredRSNum
int
)
error
{
return
wait
.
Poll
(
Poll
,
5
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
var
oldRSs
[]
*
extensions
.
ReplicaSet
var
d
*
extensions
.
Deployment
pollErr
:=
wait
.
PollImmediate
(
Poll
,
5
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
deployment
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Get
(
deploymentName
,
metav1
.
GetOptions
{})
deployment
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Get
(
deploymentName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
_
,
oldRSs
,
err
:=
deploymentutil
.
GetOldReplicaSets
(
deployment
,
c
)
d
=
deployment
_
,
oldRSs
,
err
=
deploymentutil
.
GetOldReplicaSets
(
deployment
,
c
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
return
len
(
oldRSs
)
==
desiredRSNum
,
nil
return
len
(
oldRSs
)
==
desiredRSNum
,
nil
})
})
if
pollErr
==
wait
.
ErrWaitTimeout
{
pollErr
=
fmt
.
Errorf
(
"%d old replica sets were not cleaned up for deployment %q"
,
len
(
oldRSs
)
-
desiredRSNum
,
deploymentName
)
logReplicaSetsOfDeployment
(
d
,
oldRSs
,
nil
)
}
return
pollErr
}
}
func
logReplicaSetsOfDeployment
(
deployment
*
extensions
.
Deployment
,
allOldRSs
[]
*
extensions
.
ReplicaSet
,
newRS
*
extensions
.
ReplicaSet
)
{
func
logReplicaSetsOfDeployment
(
deployment
*
extensions
.
Deployment
,
allOldRSs
[]
*
extensions
.
ReplicaSet
,
newRS
*
extensions
.
ReplicaSet
)
{
...
...
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