delete temporary image container

pull/6918/head
Matthew Hooker 8 years ago
parent 21f786d686
commit cd77d00fd8
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1

@ -119,9 +119,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
SSHConfig: b.config.Comm.SSHConfigFunc(),
},
&stepCreateImage{
uploadImageCommand: b.config.BuilderUploadImageCommand,
destinationContainer: fmt.Sprintf("packer-pv-image-%s", runID),
imageName: b.config.ImageName,
uploadImageCommand: b.config.BuilderUploadImageCommand,
tempContainer: fmt.Sprintf("packer-pv-image-%s", runID),
imageName: b.config.ImageName,
},
&common.StepCleanupTempKeys{
Comm: &b.config.Comm,

@ -63,7 +63,11 @@ curl -v -X PUT \
-H "X-Auth-Token: $AUTH_TOKEN" \
"${STORAGE_URL}/compute_images/{{.ImageName}}.tar.gz?multipart-manifest=put" \
-T ./manifest.json
'...'`
curl -v -X DELETE \
-H "X-Auth-Token: $AUTH_TOKEN" \
${STORAGE_URL}/{{.Container}}
`
}
/*
errs = packer.MultiErrorAppend(errs,

@ -13,9 +13,9 @@ import (
)
type stepCreateImage struct {
uploadImageCommand string
destinationContainer string
imageName string
uploadImageCommand string
tempContainer string
imageName string
}
type uploadCmdData struct {
@ -37,7 +37,7 @@ func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multi
Username: config.Username,
Password: config.Password,
AccountID: config.IdentityDomain,
Container: s.destinationContainer,
Container: s.tempContainer,
ImageName: s.imageName,
}
uploadImageCmd, err := interpolate.Render(s.uploadImageCommand, &config.ctx)
@ -103,10 +103,9 @@ func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multi
2. re-use step_list_images
3. Don't push commits with passwords in them
4. Documentation
5. Configuration (master/builder images, entry, destination stuff, etc)
5. Configuration (master/builder images & entry, destination stuff, etc)
6. split master/builder image/connection config. i.e. build anything, master only linux
7. correct artifact
8. Delete upload container
*/
//machineImageClient.CreateMachineImage()

Loading…
Cancel
Save