job: set S3 key to compose id

cockpit-composer currently doesn't require setting the S3 key. Set it to
the compose ID if it's empty.
This commit is contained in:
Lars Karlitski 2019-11-29 16:35:13 +01:00 committed by Tom Gundersen
parent f4991cb1ca
commit b53d897019

View file

@ -109,6 +109,10 @@ func (job *Job) Run(d distro.Distro) (error, []error) {
continue
}
if options.Key == "" {
options.Key = job.ID.String()
}
_, err = a.Upload("/var/cache/osbuild-composer/store/refs/"+result.OutputID+"/image.ami", options.Bucket, options.Key)
if err != nil {
r = append(r, err)