job/osbuild: better logging for container uploads
Add some more logging to the container uploads, which is esp. helpful in the case something goes wrong.
This commit is contained in:
parent
9f8df4313c
commit
c845a11881
1 changed files with 5 additions and 1 deletions
|
|
@ -813,7 +813,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
|
|||
targetResult = target.NewContainerTargetResult(nil)
|
||||
destination := jobTarget.ImageName
|
||||
|
||||
logWithId.Printf("[container] ⬆ Uploading the image to %s", destination)
|
||||
logWithId.Printf("[container] 📦 Preparing upload to '%s'", destination)
|
||||
|
||||
client, err := impl.getContainerClient(destination, targetOptions)
|
||||
if err != nil {
|
||||
|
|
@ -821,13 +821,17 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
|
|||
break
|
||||
}
|
||||
|
||||
logWithId.Printf("[container] ⬆ Uploading the image to %s", client.Target.String())
|
||||
|
||||
sourcePath := path.Join(outputDirectory, jobTarget.OsbuildArtifact.ExportName, jobTarget.OsbuildArtifact.ExportFilename)
|
||||
|
||||
// TODO: get the container type from the metadata of the osbuild job
|
||||
sourceRef := fmt.Sprintf("oci-archive:%s", sourcePath)
|
||||
|
||||
digest, err := client.UploadImage(context.Background(), sourceRef, "")
|
||||
|
||||
if err != nil {
|
||||
logWithId.Infof("[container] 🙁 Upload of '%s' failed: %v", sourceRef, err)
|
||||
targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorUploadingImage, err.Error())
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue