Skip to content

Commit

Permalink
worker/gcp: return error if job doesn't specify object key
Browse files Browse the repository at this point in the history
The object key is required in order to upload the image to GCP. Return
an error if it is not set.
  • Loading branch information
thozza authored and ondrejbudai committed Oct 11, 2022
1 parent 809107c commit dd36fce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/osbuild-worker/jobimpl-osbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
break
}

if targetOptions.Object == "" {
targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidTargetConfig, "No GCP object key provided", nil)
break
}

bucket := targetOptions.Bucket
if bucket == "" {
bucket = impl.GCPConfig.Bucket
Expand Down

0 comments on commit dd36fce

Please sign in to comment.