diff --git a/builder/oracle/classic/builder.go b/builder/oracle/classic/builder.go index 1e1245421..da7975dd4 100644 --- a/builder/oracle/classic/builder.go +++ b/builder/oracle/classic/builder.go @@ -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, diff --git a/builder/oracle/classic/pv_config.go b/builder/oracle/classic/pv_config.go index 2e85eb21c..6d370801b 100644 --- a/builder/oracle/classic/pv_config.go +++ b/builder/oracle/classic/pv_config.go @@ -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, diff --git a/builder/oracle/classic/step_create_image.go b/builder/oracle/classic/step_create_image.go index f55f89118..1500fb908 100644 --- a/builder/oracle/classic/step_create_image.go +++ b/builder/oracle/classic/step_create_image.go @@ -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()