Skip to content

Commit

Permalink
Add debugging information for test image upload
Browse files Browse the repository at this point in the history
Signed-off-by: Nolan Brubaker <[email protected]>
  • Loading branch information
nrb committed Dec 12, 2024
1 parent dc86e24 commit a07663d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/shared/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ func ensureTestImageUploaded(e2eCtx *E2EContext) error {
}

imageSha := strings.ReplaceAll(strings.TrimSuffix(stdOut.String(), "\n"), "'", "")
fmt.Fprintf(GinkgoWriter, "got container SHA")

ecrImageName := repoName + ":e2e"
cmd = exec.Command("docker", "tag", imageSha, ecrImageName) //nolint:gosec
Expand All @@ -704,6 +705,8 @@ func ensureTestImageUploaded(e2eCtx *E2EContext) error {
return err
}

fmt.Fprintf(GinkgoWriter, "tagged ECR image")

outToken, err := ecrSvc.GetAuthorizationToken(&ecrpublic.GetAuthorizationTokenInput{})
if err != nil {
return err
Expand All @@ -723,11 +726,14 @@ func ensureTestImageUploaded(e2eCtx *E2EContext) error {
return err
}

fmt.Fprintf(GinkgoWriter, "logged in to public.ecr.aws")

cmd = exec.Command("docker", "push", ecrImageName)
err = cmd.Run()
if err != nil {
return err
}
fmt.Fprintf(GinkgoWriter, "pushed e2e image %q", ecrImageName)
e2eCtx.E2EConfig.Variables["CAPI_IMAGES_REGISTRY"] = repoName
e2eCtx.E2EConfig.Variables["E2E_IMAGE_TAG"] = "e2e"
return nil
Expand Down

0 comments on commit a07663d

Please sign in to comment.