@@ -84,6 +84,7 @@ func NewDesiredStateOfWorldPopulator(
84
84
podManager pod.Manager ,
85
85
podStatusProvider status.PodStatusProvider ,
86
86
desiredStateOfWorld cache.DesiredStateOfWorld ,
87
+ actualStateOfWorld cache.ActualStateOfWorld ,
87
88
kubeContainerRuntime kubecontainer.Runtime ,
88
89
keepTerminatedPodVolumes bool ) DesiredStateOfWorldPopulator {
89
90
return & desiredStateOfWorldPopulator {
@@ -93,6 +94,7 @@ func NewDesiredStateOfWorldPopulator(
93
94
podManager : podManager ,
94
95
podStatusProvider : podStatusProvider ,
95
96
desiredStateOfWorld : desiredStateOfWorld ,
97
+ actualStateOfWorld : actualStateOfWorld ,
96
98
pods : processedPods {
97
99
processedPods : make (map [volumetypes.UniquePodName ]bool )},
98
100
kubeContainerRuntime : kubeContainerRuntime ,
@@ -109,6 +111,7 @@ type desiredStateOfWorldPopulator struct {
109
111
podManager pod.Manager
110
112
podStatusProvider status.PodStatusProvider
111
113
desiredStateOfWorld cache.DesiredStateOfWorld
114
+ actualStateOfWorld cache.ActualStateOfWorld
112
115
pods processedPods
113
116
kubeContainerRuntime kubecontainer.Runtime
114
117
timeOfLastGetPodStatus time.Time
@@ -237,13 +240,13 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedPods() {
237
240
}
238
241
239
242
if runningContainers {
240
- glog .V (5 ).Infof (
243
+ glog .V (4 ).Infof (
241
244
"Pod %q has been removed from pod manager. However, it still has one or more containers in the non-exited state. Therefore, it will not be removed from volume manager." ,
242
245
format .Pod (volumeToMount .Pod ))
243
246
continue
244
247
}
245
248
246
- glog .V (5 ).Infof (volumeToMount .GenerateMsgDetailed ("Removing volume from desired state" , "" ))
249
+ glog .V (4 ).Infof (volumeToMount .GenerateMsgDetailed ("Removing volume from desired state" , "" ))
247
250
248
251
dswp .desiredStateOfWorld .DeletePodFromVolume (
249
252
volumeToMount .PodName , volumeToMount .VolumeName )
@@ -293,7 +296,7 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes(pod *v1.Pod) {
293
296
allVolumesAdded = false
294
297
}
295
298
296
- glog .V (10 ).Infof (
299
+ glog .V (4 ).Infof (
297
300
"Added volume %q (volSpec=%q) for pod %q to desired state." ,
298
301
podVolume .Name ,
299
302
volumeSpec .Name (),
@@ -303,6 +306,9 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes(pod *v1.Pod) {
303
306
// some of the volume additions may have failed, should not mark this pod as fully processed
304
307
if allVolumesAdded {
305
308
dswp .markPodProcessed (uniquePodName )
309
+ // New pod has been synced. Re-mount all volumes that need it
310
+ // (e.g. DownwardAPI)
311
+ dswp .actualStateOfWorld .MarkRemountRequired (uniquePodName )
306
312
}
307
313
308
314
}
@@ -344,7 +350,7 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec(
344
350
podVolume v1.Volume , podName string , podNamespace string , mountsMap map [string ]bool , devicesMap map [string ]bool ) (* volume.Spec , string , error ) {
345
351
if pvcSource :=
346
352
podVolume .VolumeSource .PersistentVolumeClaim ; pvcSource != nil {
347
- glog .V (10 ).Infof (
353
+ glog .V (5 ).Infof (
348
354
"Found PVC, ClaimName: %q/%q" ,
349
355
podNamespace ,
350
356
pvcSource .ClaimName )
@@ -360,7 +366,7 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec(
360
366
err )
361
367
}
362
368
363
- glog .V (10 ).Infof (
369
+ glog .V (5 ).Infof (
364
370
"Found bound PV for PVC (ClaimName %q/%q pvcUID %v): pvName=%q" ,
365
371
podNamespace ,
366
372
pvcSource .ClaimName ,
@@ -378,7 +384,7 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec(
378
384
err )
379
385
}
380
386
381
- glog .V (10 ).Infof (
387
+ glog .V (5 ).Infof (
382
388
"Extracted volumeSpec (%v) from bound PV (pvName %q) and PVC (ClaimName %q/%q pvcUID %v)" ,
383
389
volumeSpec .Name ,
384
390
pvName ,
0 commit comments