Skip to content

Commit

Permalink
Renamed function name
Browse files Browse the repository at this point in the history
Signed-off-by: kumari tanushree <ktanushree@vmware.com>
  • Loading branch information
kumari tanushree committed Jan 17, 2024
1 parent 50da503 commit f2dc7d3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
76 changes: 38 additions & 38 deletions test/e2e/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ images:
},
)

digestSha := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + imageDigest)
digestSha := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + imageDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s%s
Type: Image
Expand All @@ -80,7 +80,7 @@ images:
some.other.annotation: some other value
`, env.RelocationRepo, imageDigest, env.Image, imageDigest, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + imgSigDigest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + imgSigDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s@%s
Type: Signature
Expand All @@ -90,7 +90,7 @@ images:
tag: %s
`, env.RelocationRepo, imgSigDigest, digestSha[0], imgSigTag))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + bundleSigDigest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + bundleSigDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s@%s
Type: Signature
Expand All @@ -100,7 +100,7 @@ images:
tag: %s
`, env.RelocationRepo, bundleSigDigest, digestSha[0], bundleSigTag))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsImgDigest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsImgDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s@%s
Type: Internal
Expand Down Expand Up @@ -179,7 +179,7 @@ images:
locationsNestedBundleImgDigest := env.ImageFactory.ImageDigest(fmt.Sprintf("%s:%s.image-locations.imgpkg", env.RelocationRepo, strings.ReplaceAll(nestedBundleDigest[1:], ":", "-")))
locationsOuterBundleImgDigest := env.ImageFactory.ImageDigest(fmt.Sprintf("%s:%s.image-locations.imgpkg", env.RelocationRepo, strings.ReplaceAll(outerBundleDigest[1:], ":", "-")))

digestSha := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + nestedBundleDigest)
digestSha := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + nestedBundleDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s%s
Type: Bundle
Expand All @@ -190,7 +190,7 @@ images:
what is this: this is the nested bundle
`, env.RelocationRepo, nestedBundleDigest, nestedBundle, nestedBundleDigest, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + img1Digest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + img1Digest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s%s
Type: Image
Expand All @@ -199,7 +199,7 @@ images:
- Digest: %s
`, env.RelocationRepo, img1Digest, img1DigestRef, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + img2Digest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + img2Digest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s%s
Type: Image
Expand All @@ -208,15 +208,15 @@ images:
- Digest: %s
`, env.RelocationRepo, img2Digest, img2DigestRef, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsNestedBundleImgDigest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsNestedBundleImgDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s@%s
Type: Internal
Layers:
- Digest: %s
`, env.RelocationRepo, locationsNestedBundleImgDigest, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + img1Digest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + img1Digest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s%s
Type: Image
Expand All @@ -227,7 +227,7 @@ images:
what is this: this is just an image
`, env.RelocationRepo, img1Digest, img1DigestRef, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsOuterBundleImgDigest)
digestSha = env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsOuterBundleImgDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s@%s
Type: Internal
Expand Down Expand Up @@ -299,7 +299,7 @@ images:
},
)

digestSha := env.ImageFactory.GetImageLayerDigest(nestedBundle + nestedBundleDigest)
digestSha := env.ImageFactory.GetImageLayersDigest(nestedBundle + nestedBundleDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s%s
Type: Bundle
Expand All @@ -308,7 +308,7 @@ images:
- Digest: %s
`, nestedBundle, nestedBundleDigest, nestedBundle, nestedBundleDigest, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(img1DigestRef)
digestSha = env.ImageFactory.GetImageLayersDigest(img1DigestRef)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s
Type: Image
Expand All @@ -317,7 +317,7 @@ images:
- Digest: %s
`, img1DigestRef, img1DigestRef, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(img2DigestRef)
digestSha = env.ImageFactory.GetImageLayersDigest(img2DigestRef)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s
Type: Image
Expand All @@ -326,7 +326,7 @@ images:
- Digest: %s
`, img2DigestRef, img2DigestRef, digestSha[0]))

digestSha = env.ImageFactory.GetImageLayerDigest(imgRef.Context().Name() + "-img2" + "@" + img2SigDigest)
digestSha = env.ImageFactory.GetImageLayersDigest(imgRef.Context().Name() + "-img2" + "@" + img2SigDigest)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s@%s
Type: Signature
Expand All @@ -336,7 +336,7 @@ images:
tag: %s
`, imgRef.Context().Name()+"-img2", img2SigDigest, digestSha[0], img2SigTag))

digestSha = env.ImageFactory.GetImageLayerDigest(img1DigestRef)
digestSha = env.ImageFactory.GetImageLayersDigest(img1DigestRef)
assert.Contains(t, stdout, fmt.Sprintf(
` - Image: %s
Type: Image
Expand Down Expand Up @@ -403,11 +403,11 @@ images:

stdoutLines := strings.Split(stdout, "\n")
stdout = strings.Join(stdoutLines[:len(stdoutLines)-1], "\n")
digestSha1 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + imageDigest)
digestSha2 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + bundleSigDigest)
digestSha3 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + imgSigDigest)
digestSha4 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsImgDigest)
digestSha5 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + bundleDigest)
digestSha1 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + imageDigest)
digestSha2 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + bundleSigDigest)
digestSha3 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + imgSigDigest)
digestSha4 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsImgDigest)
digestSha5 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + bundleDigest)
require.YAMLEq(t, fmt.Sprintf(`sha: %s
content:
images:
Expand Down Expand Up @@ -519,11 +519,11 @@ images:
},
)
locationsImgDigest := env.ImageFactory.ImageDigest(fmt.Sprintf("%s:%s.image-locations.imgpkg", env.RelocationRepo, strings.ReplaceAll(bundleDigest[1:], ":", "-")))
digestSha1 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + imageDigest)
digestSha2 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + bundleSigDigest)
digestSha3 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + imgSigDigest)
digestSha4 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsImgDigest)
digestSha5 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + bundleDigest)
digestSha1 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + imageDigest)
digestSha2 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + bundleSigDigest)
digestSha3 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + imgSigDigest)
digestSha4 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsImgDigest)
digestSha5 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + bundleDigest)
require.YAMLEq(t, fmt.Sprintf(`content:
images:
"%s":
Expand Down Expand Up @@ -653,13 +653,13 @@ images:
locationsOuterBundleImgDigest := env.ImageFactory.ImageDigest(fmt.Sprintf("%s:%s.image-locations.imgpkg", env.RelocationRepo, strings.ReplaceAll(outerBundleDigest[1:], ":", "-")))
stdoutLines := strings.Split(stdout, "\n")
stdout = strings.Join(stdoutLines[:len(stdoutLines)-1], "\n")
digestSha1 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + img1Digest)
digestSha2 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + img2Digest)
digestSha3 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsNestedBundleImgDigest)
digestSha4 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + nestedBundleDigest)
digestSha5 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + img1Digest)
digestSha6 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + "@" + locationsOuterBundleImgDigest)
digestSha7 := env.ImageFactory.GetImageLayerDigest(env.RelocationRepo + outerBundleDigest)
digestSha1 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + img1Digest)
digestSha2 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + img2Digest)
digestSha3 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsNestedBundleImgDigest)
digestSha4 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + nestedBundleDigest)
digestSha5 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + img1Digest)
digestSha6 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + "@" + locationsOuterBundleImgDigest)
digestSha7 := env.ImageFactory.GetImageLayersDigest(env.RelocationRepo + outerBundleDigest)
require.YAMLEq(t, fmt.Sprintf(`sha: %s
content:
bundles:
Expand Down Expand Up @@ -794,12 +794,12 @@ images:

stdoutLines := strings.Split(stdout, "\n")
stdout = strings.Join(stdoutLines[:len(stdoutLines)-1], "\n")
digestSha1 := env.ImageFactory.GetImageLayerDigest(img1DigestRef)
digestSha2 := env.ImageFactory.GetImageLayerDigest(img2DigestRef)
digestSha3 := env.ImageFactory.GetImageLayerDigest(imgRef.Context().Name() + "-img2" + "@" + img2SigDigest)
digestSha4 := env.ImageFactory.GetImageLayerDigest(nestedBundle + nestedBundleDigest)
digestSha5 := env.ImageFactory.GetImageLayerDigest(img1DigestRef)
digestSha6 := env.ImageFactory.GetImageLayerDigest(outerBundle + outerBundleDigest)
digestSha1 := env.ImageFactory.GetImageLayersDigest(img1DigestRef)
digestSha2 := env.ImageFactory.GetImageLayersDigest(img2DigestRef)
digestSha3 := env.ImageFactory.GetImageLayersDigest(imgRef.Context().Name() + "-img2" + "@" + img2SigDigest)
digestSha4 := env.ImageFactory.GetImageLayersDigest(nestedBundle + nestedBundleDigest)
digestSha5 := env.ImageFactory.GetImageLayersDigest(img1DigestRef)
digestSha6 := env.ImageFactory.GetImageLayersDigest(outerBundle + outerBundleDigest)
require.YAMLEq(t, fmt.Sprintf(`sha: %s
content:
bundles:
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/image_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func (i *ImageFactory) ImageDigest(imgRef string) string {
return digest.String()
}

// GetImageLayerDigest will return image's layer digest
func (i *ImageFactory) GetImageLayerDigest(image string) []string {
// GetImageLayersDigest will return image's layers digest
func (i *ImageFactory) GetImageLayersDigest(image string) []string {
parsedImgRef, err := name.ParseReference(image, name.WeakValidation)
require.NoError(i.T, err)

Expand Down

0 comments on commit f2dc7d3

Please sign in to comment.