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
20838c33
Commit
20838c33
authored
Mar 04, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22560 from janetkuo/pod-update-delete-log
Auto commit by PR queue bot
parents
0f335df1
59b1f5b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+4
-4
replica_set.go
pkg/controller/replicaset/replica_set.go
+4
-1
No files found.
pkg/controller/deployment/deployment_controller.go
View file @
20838c33
...
...
@@ -310,7 +310,7 @@ func (dc *DeploymentController) addPod(obj interface{}) {
if
!
ok
{
return
}
glog
.
V
(
4
)
.
Infof
(
"Pod %s created
."
,
pod
.
Name
)
glog
.
V
(
4
)
.
Infof
(
"Pod %s created
: %+v."
,
pod
.
Name
,
pod
)
if
d
:=
dc
.
getDeploymentForPod
(
pod
);
d
!=
nil
{
dc
.
enqueueDeployment
(
d
)
}
...
...
@@ -324,11 +324,11 @@ func (dc *DeploymentController) updatePod(old, cur interface{}) {
return
}
curPod
:=
cur
.
(
*
api
.
Pod
)
glog
.
V
(
4
)
.
Infof
(
"Pod %s updated."
,
curPod
.
Name
)
oldPod
:=
old
.
(
*
api
.
Pod
)
glog
.
V
(
4
)
.
Infof
(
"Pod %s updated %+v -> %+v."
,
curPod
.
Name
,
oldPod
,
curPod
)
if
d
:=
dc
.
getDeploymentForPod
(
curPod
);
d
!=
nil
{
dc
.
enqueueDeployment
(
d
)
}
oldPod
:=
old
.
(
*
api
.
Pod
)
if
!
api
.
Semantic
.
DeepEqual
(
oldPod
,
curPod
)
{
if
oldD
:=
dc
.
getDeploymentForPod
(
oldPod
);
oldD
!=
nil
{
dc
.
enqueueDeployment
(
oldD
)
...
...
@@ -357,7 +357,7 @@ func (dc *DeploymentController) deletePod(obj interface{}) {
return
}
}
glog
.
V
(
4
)
.
Infof
(
"Pod %s deleted
."
,
pod
.
Name
)
glog
.
V
(
4
)
.
Infof
(
"Pod %s deleted
: %+v."
,
pod
.
Name
,
pod
)
if
d
:=
dc
.
getDeploymentForPod
(
pod
);
d
!=
nil
{
dc
.
enqueueDeployment
(
d
)
}
...
...
pkg/controller/replicaset/replica_set.go
View file @
20838c33
...
...
@@ -289,6 +289,7 @@ func isReplicaSetMatch(pod *api.Pod, rs *extensions.ReplicaSet) bool {
// When a pod is created, enqueue the replica set that manages it and update it's expectations.
func
(
rsc
*
ReplicaSetController
)
addPod
(
obj
interface
{})
{
pod
:=
obj
.
(
*
api
.
Pod
)
glog
.
V
(
4
)
.
Infof
(
"Pod %s created: %+v."
,
pod
.
Name
,
pod
)
rs
:=
rsc
.
getPodReplicaSet
(
pod
)
if
rs
==
nil
{
...
...
@@ -319,6 +320,8 @@ func (rsc *ReplicaSetController) updatePod(old, cur interface{}) {
return
}
curPod
:=
cur
.
(
*
api
.
Pod
)
oldPod
:=
old
.
(
*
api
.
Pod
)
glog
.
V
(
4
)
.
Infof
(
"Pod %s updated %+v -> %+v."
,
curPod
.
Name
,
oldPod
,
curPod
)
rs
:=
rsc
.
getPodReplicaSet
(
curPod
)
if
rs
==
nil
{
return
...
...
@@ -328,7 +331,6 @@ func (rsc *ReplicaSetController) updatePod(old, cur interface{}) {
glog
.
Errorf
(
"Couldn't get key for replication controller %#v: %v"
,
rs
,
err
)
return
}
oldPod
:=
old
.
(
*
api
.
Pod
)
if
curPod
.
DeletionTimestamp
!=
nil
&&
oldPod
.
DeletionTimestamp
==
nil
{
// when a pod is deleted gracefully it's deletion timestamp is first modified to reflect a grace period,
...
...
@@ -373,6 +375,7 @@ func (rsc *ReplicaSetController) deletePod(obj interface{}) {
return
}
}
glog
.
V
(
4
)
.
Infof
(
"Pod %s deleted: %+v."
,
pod
.
Name
,
pod
)
if
rs
:=
rsc
.
getPodReplicaSet
(
pod
);
rs
!=
nil
{
rsKey
,
err
:=
controller
.
KeyFunc
(
rs
)
if
err
!=
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