mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #101147 from soltysh/wrong_substring
Limit image spec's hash length
This commit is contained in:
		@@ -306,7 +306,7 @@ func getRepositoryMappedConfig(index int, config Config, repo string) Config {
 | 
			
		||||
 | 
			
		||||
	h := sha256.New()
 | 
			
		||||
	h.Write([]byte(pullSpec))
 | 
			
		||||
	hash := base64.RawURLEncoding.EncodeToString(h.Sum(nil)[:16])
 | 
			
		||||
	hash := base64.RawURLEncoding.EncodeToString(h.Sum(nil))[:16]
 | 
			
		||||
 | 
			
		||||
	shortName := reCharSafe.ReplaceAllLiteralString(pullSpec, "-")
 | 
			
		||||
	shortName = reDashes.ReplaceAllLiteralString(shortName, "-")
 | 
			
		||||
 
 | 
			
		||||
@@ -149,7 +149,7 @@ func TestGetMappedImageConfigs(t *testing.T) {
 | 
			
		||||
		actual[source.GetE2EImage()] = mapping.GetE2EImage()
 | 
			
		||||
	}
 | 
			
		||||
	expected := map[string]string{
 | 
			
		||||
		"docker.io/source/repo:1.0": "quay.io/repo/for-test:e2e-0-docker-io-source-repo-1-0-72R4aXm7YnxQ4_ekf1DrFA",
 | 
			
		||||
		"docker.io/source/repo:1.0": "quay.io/repo/for-test:e2e-0-docker-io-source-repo-1-0-72R4aXm7YnxQ4_ek",
 | 
			
		||||
	}
 | 
			
		||||
	if !reflect.DeepEqual(expected, actual) {
 | 
			
		||||
		t.Fatal(diff.ObjectReflectDiff(expected, actual))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user