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
4f98c6fc
Unverified
Commit
4f98c6fc
authored
May 22, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 22, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #78104 from Pingan2017/update-translate-time
update LastTransitionTime for pod ready condition when node notready
parents
a27d3aef
0a8d7aad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
BUILD
pkg/controller/util/node/BUILD
+1
-0
controller_utils.go
pkg/controller/util/node/controller_utils.go
+6
-2
No files found.
pkg/controller/util/node/BUILD
View file @
4f98c6fc
...
@@ -6,6 +6,7 @@ go_library(
...
@@ -6,6 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/controller/util/node",
importpath = "k8s.io/kubernetes/pkg/controller/util/node",
visibility = ["//visibility:public"],
visibility = ["//visibility:public"],
deps = [
deps = [
"//pkg/api/v1/pod:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/kubelet/util/format:go_default_library",
"//pkg/kubelet/util/format:go_default_library",
...
...
pkg/controller/util/node/controller_utils.go
View file @
4f98c6fc
...
@@ -32,6 +32,7 @@ import (
...
@@ -32,6 +32,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
clientset
"k8s.io/client-go/kubernetes"
clientset
"k8s.io/client-go/kubernetes"
appsv1listers
"k8s.io/client-go/listers/apps/v1"
appsv1listers
"k8s.io/client-go/listers/apps/v1"
utilpod
"k8s.io/kubernetes/pkg/api/v1/pod"
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/kubelet/util/format"
...
@@ -134,9 +135,12 @@ func MarkAllPodsNotReady(kubeClient clientset.Interface, node *v1.Node) error {
...
@@ -134,9 +135,12 @@ func MarkAllPodsNotReady(kubeClient clientset.Interface, node *v1.Node) error {
continue
continue
}
}
for
i
,
cond
:=
range
pod
.
Status
.
Conditions
{
for
_
,
cond
:=
range
pod
.
Status
.
Conditions
{
if
cond
.
Type
==
v1
.
PodReady
{
if
cond
.
Type
==
v1
.
PodReady
{
pod
.
Status
.
Conditions
[
i
]
.
Status
=
v1
.
ConditionFalse
cond
.
Status
=
v1
.
ConditionFalse
if
!
utilpod
.
UpdatePodCondition
(
&
pod
.
Status
,
&
cond
)
{
break
}
klog
.
V
(
2
)
.
Infof
(
"Updating ready status of pod %v to false"
,
pod
.
Name
)
klog
.
V
(
2
)
.
Infof
(
"Updating ready status of pod %v to false"
,
pod
.
Name
)
_
,
err
:=
kubeClient
.
CoreV1
()
.
Pods
(
pod
.
Namespace
)
.
UpdateStatus
(
&
pod
)
_
,
err
:=
kubeClient
.
CoreV1
()
.
Pods
(
pod
.
Namespace
)
.
UpdateStatus
(
&
pod
)
if
err
!=
nil
{
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