mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #42251 from justinsb/simplify_append
Automatic merge from submit-queue (batch tested with PRs 42252, 42251, 42249, 47512, 47887) volumes: simplify append-to-slice code Minor simplification - can append to empty/nil slice. Part of #40583 ```release-note NONE ```
This commit is contained in:
		@@ -596,10 +596,7 @@ func (asw *actualStateOfWorld) GetAttachedVolumesPerNode() map[types.NodeName][]
 | 
			
		||||
	attachedVolumesPerNode := make(map[types.NodeName][]operationexecutor.AttachedVolume)
 | 
			
		||||
	for _, volumeObj := range asw.attachedVolumes {
 | 
			
		||||
		for nodeName, nodeObj := range volumeObj.nodesAttachedTo {
 | 
			
		||||
			volumes, exists := attachedVolumesPerNode[nodeName]
 | 
			
		||||
			if !exists {
 | 
			
		||||
				volumes = []operationexecutor.AttachedVolume{}
 | 
			
		||||
			}
 | 
			
		||||
			volumes := attachedVolumesPerNode[nodeName]
 | 
			
		||||
			volumes = append(volumes, getAttachedVolume(&volumeObj, &nodeObj).AttachedVolume)
 | 
			
		||||
			attachedVolumesPerNode[nodeName] = volumes
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user