mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #31942 from smarterclayton/debug_conversion
Automatic merge from submit-queue Make it easier to debug conversion mismatches @thockin made finding mismatches easier
This commit is contained in:
		@@ -359,6 +359,7 @@ func isDirectlyConvertible(in, out *types.Type, manualConversions conversionFunc
 | 
			
		||||
			// Check if there is an out member with that name.
 | 
			
		||||
			outMember, found := findMember(out, inMember.Name)
 | 
			
		||||
			if !found {
 | 
			
		||||
				glog.V(5).Infof("%s.%s is not directly convertible to %s because the destination struct field did not exist", in.Name, inMember.Name, out.Name)
 | 
			
		||||
				return false
 | 
			
		||||
			}
 | 
			
		||||
			convertible = convertible && isConvertible(inMember.Type, outMember.Type, manualConversions)
 | 
			
		||||
@@ -577,7 +578,11 @@ func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.W
 | 
			
		||||
		g.generateConversion(peerType, t, sw)
 | 
			
		||||
	}
 | 
			
		||||
	if didForward != didBackward {
 | 
			
		||||
		glog.Fatalf("Could only generate one direction of conversion for %v <-> %v", t, peerType)
 | 
			
		||||
		if didForward {
 | 
			
		||||
			glog.Fatalf("Could only generate one direction of conversion for %v -> %v", t, peerType)
 | 
			
		||||
		} else {
 | 
			
		||||
			glog.Fatalf("Could only generate one direction of conversion for %v <- %v", t, peerType)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if !didForward && !didBackward {
 | 
			
		||||
		// TODO: This should be fatal but we have at least 8 types that
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user