mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Fix bug when getting old RCs of a deployment
This commit is contained in:
		@@ -61,7 +61,11 @@ func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.Rep
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	requiredRCs := []*api.ReplicationController{}
 | 
			
		||||
	for _, value := range oldRCs {
 | 
			
		||||
	// Note that go reuses the same memory location for every iteration,
 | 
			
		||||
	// which means the 'value' returned from range will have the same address.
 | 
			
		||||
	// Therefore, we should use the returned 'index' instead.
 | 
			
		||||
	for i := range oldRCs {
 | 
			
		||||
		value := oldRCs[i]
 | 
			
		||||
		requiredRCs = append(requiredRCs, &value)
 | 
			
		||||
	}
 | 
			
		||||
	return requiredRCs, nil
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user