Unverified Commit 2f39e8a0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #57724 from mlmhl/ad_controller_populateDesiredStateOfWorld

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix populateDesiredStateOfWorld bug for attach/detach controller **What this PR does / why we need it**: The `attachDetachController.populateDesiredStateOfWorld` mehod will fetch all pods from the informer cache and add each pods to `DesiredStateOfWorld` by the [addPod method](https://github.com/kubernetes/kubernetes/blob/da9a4d5da9ecc6f687c873fb990d662b1f9f98b2/pkg/controller/volume/attachdetach/attach_detach_controller.go#L338). However, the element type of pod list returned by `podLister.List` is already `*v1.Pod`, so we needn't to take the address any more. **Release note**: ```release-note NONE ``` /sig storage /kind bug
parents b4ad7e6e 0e6ac1df
...@@ -335,7 +335,7 @@ func (adc *attachDetachController) populateDesiredStateOfWorld() error { ...@@ -335,7 +335,7 @@ func (adc *attachDetachController) populateDesiredStateOfWorld() error {
} }
for _, pod := range pods { for _, pod := range pods {
podToAdd := pod podToAdd := pod
adc.podAdd(&podToAdd) adc.podAdd(podToAdd)
for _, podVolume := range podToAdd.Spec.Volumes { for _, podVolume := range podToAdd.Spec.Volumes {
// The volume specs present in the ActualStateOfWorld are nil, let's replace those // The volume specs present in the ActualStateOfWorld are nil, let's replace those
// with the correct ones found on pods. The present in the ASW with no corresponding // with the correct ones found on pods. The present in the ASW with no corresponding
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment