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
236b454c
Commit
236b454c
authored
Sep 25, 2015
by
Brian Grant
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14557 from sdminonne/downwardapi_volume
Partial fix for issue #14263
parents
a6461a51
32f56619
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
config.go
pkg/kubelet/config/config.go
+2
-0
config_test.go
pkg/kubelet/config/config_test.go
+23
-0
No files found.
pkg/kubelet/config/config.go
View file @
236b454c
...
@@ -400,6 +400,7 @@ func updateAnnotations(existing, ref *api.Pod) {
...
@@ -400,6 +400,7 @@ func updateAnnotations(existing, ref *api.Pod) {
func
podsDifferSemantically
(
existing
,
ref
*
api
.
Pod
)
bool
{
func
podsDifferSemantically
(
existing
,
ref
*
api
.
Pod
)
bool
{
if
reflect
.
DeepEqual
(
existing
.
Spec
,
ref
.
Spec
)
&&
if
reflect
.
DeepEqual
(
existing
.
Spec
,
ref
.
Spec
)
&&
reflect
.
DeepEqual
(
existing
.
Labels
,
ref
.
Labels
)
&&
reflect
.
DeepEqual
(
existing
.
DeletionTimestamp
,
ref
.
DeletionTimestamp
)
&&
reflect
.
DeepEqual
(
existing
.
DeletionTimestamp
,
ref
.
DeletionTimestamp
)
&&
reflect
.
DeepEqual
(
existing
.
DeletionGracePeriodSeconds
,
ref
.
DeletionGracePeriodSeconds
)
&&
reflect
.
DeepEqual
(
existing
.
DeletionGracePeriodSeconds
,
ref
.
DeletionGracePeriodSeconds
)
&&
isAnnotationMapEqual
(
existing
.
Annotations
,
ref
.
Annotations
)
{
isAnnotationMapEqual
(
existing
.
Annotations
,
ref
.
Annotations
)
{
...
@@ -423,6 +424,7 @@ func checkAndUpdatePod(existing, ref *api.Pod) bool {
...
@@ -423,6 +424,7 @@ func checkAndUpdatePod(existing, ref *api.Pod) bool {
ref
.
Annotations
[
kubelet
.
ConfigFirstSeenAnnotationKey
]
=
existing
.
Annotations
[
kubelet
.
ConfigFirstSeenAnnotationKey
]
ref
.
Annotations
[
kubelet
.
ConfigFirstSeenAnnotationKey
]
=
existing
.
Annotations
[
kubelet
.
ConfigFirstSeenAnnotationKey
]
existing
.
Spec
=
ref
.
Spec
existing
.
Spec
=
ref
.
Spec
existing
.
Labels
=
ref
.
Labels
existing
.
DeletionTimestamp
=
ref
.
DeletionTimestamp
existing
.
DeletionTimestamp
=
ref
.
DeletionTimestamp
existing
.
DeletionGracePeriodSeconds
=
ref
.
DeletionGracePeriodSeconds
existing
.
DeletionGracePeriodSeconds
=
ref
.
DeletionGracePeriodSeconds
updateAnnotations
(
existing
,
ref
)
updateAnnotations
(
existing
,
ref
)
...
...
pkg/kubelet/config/config_test.go
View file @
236b454c
...
@@ -298,3 +298,26 @@ func TestPodUpdateAnnotations(t *testing.T) {
...
@@ -298,3 +298,26 @@ func TestPodUpdateAnnotations(t *testing.T) {
channel
<-
podUpdate
channel
<-
podUpdate
expectPodUpdate
(
t
,
ch
,
CreatePodUpdate
(
kubelet
.
UPDATE
,
TestSource
,
pod
))
expectPodUpdate
(
t
,
ch
,
CreatePodUpdate
(
kubelet
.
UPDATE
,
TestSource
,
pod
))
}
}
func
TestPodUpdateLables
(
t
*
testing
.
T
)
{
channel
,
ch
,
_
:=
createPodConfigTester
(
PodConfigNotificationIncremental
)
pod
:=
CreateValidPod
(
"foo2"
,
"new"
)
pod
.
Labels
=
make
(
map
[
string
]
string
,
0
)
pod
.
Labels
[
"key"
]
=
"value"
clone
,
err
:=
conversion
.
NewCloner
()
.
DeepCopy
(
pod
)
if
err
!=
nil
{
t
.
Fatalf
(
"%v"
,
err
)
}
podUpdate
:=
CreatePodUpdate
(
kubelet
.
SET
,
TestSource
,
clone
.
(
*
api
.
Pod
))
channel
<-
podUpdate
expectPodUpdate
(
t
,
ch
,
CreatePodUpdate
(
kubelet
.
ADD
,
TestSource
,
pod
))
pod
.
Labels
[
"key"
]
=
"newValue"
podUpdate
=
CreatePodUpdate
(
kubelet
.
SET
,
TestSource
,
pod
)
channel
<-
podUpdate
expectPodUpdate
(
t
,
ch
,
CreatePodUpdate
(
kubelet
.
UPDATE
,
TestSource
,
pod
))
}
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