mirror of https://github.com/k3s-io/k3s
Merge pull request #49420 from gnufied/fix-adc-controller-nil-spec
Automatic merge from submit-queue (batch tested with PRs 49420, 49296, 49299, 49371, 46514) Fix controller crash because of nil volume spec For volumes that don't support bulk volume verification, a nil volume spec can cause crash of controller. Fixes #49418 **Release note**: ```release-note Fixes #49418 where kube-controller-manager can panic on volume.CanSupport methods and enter a crash loop. ```pull/6/head
commit
ab35df57eb
|
@ -115,6 +115,10 @@ func (og *operationGenerator) GenerateVolumesAreAttachedFunc(
|
|||
volumeSpecMap := make(map[*volume.Spec]v1.UniqueVolumeName)
|
||||
// Iterate each volume spec and put them into a map index by the pluginName
|
||||
for _, volumeAttached := range attachedVolumes {
|
||||
if volumeAttached.VolumeSpec == nil {
|
||||
glog.Errorf("VerifyVolumesAreAttached.GenerateVolumesAreAttachedFunc: nil spec for volume %s", volumeAttached.VolumeName)
|
||||
continue
|
||||
}
|
||||
volumePlugin, err :=
|
||||
og.volumePluginMgr.FindPluginBySpec(volumeAttached.VolumeSpec)
|
||||
if err != nil || volumePlugin == nil {
|
||||
|
|
Loading…
Reference in New Issue