Skip to content

Commit

Permalink
Fix dev release, log paths of missing artifacts (#8041)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna authored Apr 24, 2024
1 parent a2ec37f commit 305e2bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion release/cli/pkg/assets/archives/archives.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func RTOSArtifactPathGetter(rc *releasetypes.ReleaseConfig, archive *assettypes.

if rc.DevRelease || rc.ReleaseEnvironment == "development" {
sourceS3Key = fmt.Sprintf("%s.%s", archive.OSName, imageExtension)
sourceS3Prefix = fmt.Sprintf("%s/%s/%s/%s/%s/%s", projectPath, eksDReleaseChannel, archive.Format, archive.OSName, archive.OSVersion, latestPath)
sourceS3Prefix = fmt.Sprintf("%s/%s", projectPath, latestPath)
} else {
sourceS3Key = fmt.Sprintf("%s-%s-eks-a-%d-%s.%s",
archive.OSName,
Expand Down
6 changes: 3 additions & 3 deletions release/cli/pkg/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ func PollForExistence(devRelease bool, authConfig *docker.AuthConfiguration, ima

bodyStr := string(body)
if strings.Contains(bodyStr, "MANIFEST_UNKNOWN") {
return fmt.Errorf("Requested image not found")
return fmt.Errorf("requested image not found")
}

return nil
})
if err != nil {
return fmt.Errorf("retries exhausted waiting for source image %s to be available for copy: %v", imageUri, err)
return fmt.Errorf("retries exhausted waiting for source image [%s] to be available for copy: %v", imageUri, err)
}

return nil
Expand Down Expand Up @@ -118,7 +118,7 @@ func CopyToDestination(sourceAuthConfig, releaseAuthConfig *docker.AuthConfigura
return nil
})
if err != nil {
return fmt.Errorf("retries exhausted performing image copy from source to destination: %v", err)
return fmt.Errorf("retries exhausted performing image copy from source [%s] to destination [%s]: %v", sourceImageUri, releaseImageUri, err)
}

return nil
Expand Down
8 changes: 4 additions & 4 deletions release/cli/pkg/operations/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func handleArchiveDownload(_ context.Context, r *releasetypes.ReleaseConfig, art
}
objectKey = filepath.Join(latestSourceS3PrefixFromMain, sourceS3Key)
} else {
return fmt.Errorf("retries exhausted waiting for archive to be uploaded to source location: %v", err)
return fmt.Errorf("retries exhausted waiting for archive [%s] to be uploaded to source location: %v", objectKey, err)
}
}

Expand Down Expand Up @@ -156,7 +156,7 @@ func handleArchiveDownload(_ context.Context, r *releasetypes.ReleaseConfig, art
}
objectShasumFileKey = filepath.Join(latestSourceS3PrefixFromMain, objectShasumFileName)
} else {
return fmt.Errorf("retries exhausted waiting for checksum file to be uploaded to source location: %v", err)
return fmt.Errorf("retries exhausted waiting for checksum file [%s] to be uploaded to source location: %v", objectShasumFileKey, err)
}
}

Expand All @@ -180,7 +180,7 @@ func handleManifestDownload(_ context.Context, r *releasetypes.ReleaseConfig, ar

err := s3Retrier.Retry(func() error {
if !s3.KeyExists(r.SourceBucket, objectKey) {
return fmt.Errorf("Requested object not found")
return fmt.Errorf("requested object not found")
}
return nil
})
Expand All @@ -194,7 +194,7 @@ func handleManifestDownload(_ context.Context, r *releasetypes.ReleaseConfig, ar
latestSourceS3PrefixFromMain := strings.NewReplacer(r.BuildRepoBranchName, "latest", artifact.Manifest.GitTag, gitTagFromMain).Replace(sourceS3Prefix)
objectKey = filepath.Join(latestSourceS3PrefixFromMain, sourceS3Key)
} else {
return fmt.Errorf("retries exhausted waiting for archive to be uploaded to source location: %v", err)
return fmt.Errorf("retries exhausted waiting for manifest [%s] to be uploaded to source location: %v", objectKey, err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions release/cli/pkg/util/artifacts/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
)

func IsObjectNotFoundError(err error) bool {
return err.Error() == "Requested object not found"
return err.Error() == "requested object not found"
}

func IsImageNotFoundError(err error) bool {
return err.Error() == "Requested image not found"
return err.Error() == "requested image not found"
}

func GetFakeSHA(hashType int) (string, error) {
Expand Down

0 comments on commit 305e2bb

Please sign in to comment.