osubild-worker: don't use job token as aws key
The job token will be deprecated in favor of URLs. If a key is not set, use a new random UUID. Also, don't overwrite the options struct with that new key.
This commit is contained in:
parent
ccebfb014c
commit
901d724622
1 changed files with 5 additions and 4 deletions
|
|
@ -120,18 +120,19 @@ func RunJob(token uuid.UUID, manifest distro.Manifest, targets []*target.Target,
|
|||
continue
|
||||
}
|
||||
|
||||
if options.Key == "" {
|
||||
options.Key = token.String()
|
||||
key := options.Key
|
||||
if key == "" {
|
||||
key = uuid.New().String()
|
||||
}
|
||||
|
||||
_, err = a.Upload(path.Join(outputDirectory, options.Filename), options.Bucket, options.Key)
|
||||
_, err = a.Upload(path.Join(outputDirectory, options.Filename), options.Bucket, key)
|
||||
if err != nil {
|
||||
r = append(r, err)
|
||||
continue
|
||||
}
|
||||
|
||||
/* TODO: communicate back the AMI */
|
||||
_, err = a.Register(t.ImageName, options.Bucket, options.Key)
|
||||
_, err = a.Register(t.ImageName, options.Bucket, key)
|
||||
if err != nil {
|
||||
r = append(r, err)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue