Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Kube OVN
Commits
a3975fe1
Unverified
Commit
a3975fe1
authored
3 years ago
by
hzma
Committed by
GitHub
3 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1340 from kubeovn/update-pod
add check for pod update process
parents
7354d0c3
ffd5c844
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/controller/inspection.go
+10
-1
pkg/controller/inspection.go
with
10 additions
and
1 deletion
+10
-1
pkg/controller/inspection.go
+
10
-
1
View file @
a3975fe1
...
...
@@ -44,11 +44,12 @@ func (c *Controller) inspectPod() error {
for
_
,
lsp
:=
range
lsps
{
if
portName
==
lsp
{
isLspExist
=
true
break
}
}
if
!
isLspExist
{
delete
(
pod
.
Annotations
,
fmt
.
Sprintf
(
util
.
AllocatedAnnotationTemplate
,
podNet
.
ProviderName
))
delete
(
pod
.
Annotations
,
util
.
RoutedAnnotation
)
delete
(
pod
.
Annotations
,
fmt
.
Sprintf
(
util
.
RoutedAnnotation
Template
,
podNet
.
ProviderName
)
)
if
_
,
err
:=
c
.
config
.
KubeClient
.
CoreV1
()
.
Pods
(
pod
.
Namespace
)
.
Patch
(
context
.
Background
(),
pod
.
Name
,
types
.
JSONPatchType
,
generatePatchPayload
(
pod
.
Annotations
,
"replace"
),
metav1
.
PatchOptions
{},
""
);
err
!=
nil
{
klog
.
Errorf
(
"patch pod %s/%s failed %v during inspection"
,
pod
.
Name
,
pod
.
Namespace
,
err
)
return
err
...
...
@@ -56,6 +57,14 @@ func (c *Controller) inspectPod() error {
klog
.
V
(
5
)
.
Infof
(
"finish remove annotation for %s"
,
portName
)
c
.
addPodQueue
.
Add
(
fmt
.
Sprintf
(
"%s/%s"
,
pod
.
Namespace
,
pod
.
Name
))
break
}
else
{
if
pod
.
Annotations
[
fmt
.
Sprintf
(
util
.
AllocatedAnnotationTemplate
,
podNet
.
ProviderName
)]
==
"true"
&&
pod
.
Spec
.
NodeName
!=
""
{
if
pod
.
Annotations
[
fmt
.
Sprintf
(
util
.
RoutedAnnotationTemplate
,
podNet
.
ProviderName
)]
!=
"true"
{
klog
.
V
(
5
)
.
Infof
(
"enqueue update pod %s/%s"
,
pod
.
Namespace
,
pod
.
Name
)
c
.
updatePodQueue
.
Add
(
fmt
.
Sprintf
(
"%s/%s"
,
pod
.
Namespace
,
pod
.
Name
))
break
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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