From 21f786d686afca849b304bd2cabf0dfe69583bf3 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 17 Oct 2018 21:46:43 -0700 Subject: [PATCH] todo and some clean up. correct values for machine image --- builder/oracle/classic/builder.go | 1 + builder/oracle/classic/step_create_image.go | 6 ++++-- builder/oracle/classic/step_create_pv_builder.go | 1 - builder/oracle/classic/step_create_pv_master.go | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/builder/oracle/classic/builder.go b/builder/oracle/classic/builder.go index 89ef14a48..1e1245421 100644 --- a/builder/oracle/classic/builder.go +++ b/builder/oracle/classic/builder.go @@ -121,6 +121,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe &stepCreateImage{ uploadImageCommand: b.config.BuilderUploadImageCommand, destinationContainer: fmt.Sprintf("packer-pv-image-%s", runID), + imageName: b.config.ImageName, }, &common.StepCleanupTempKeys{ Comm: &b.config.Comm, diff --git a/builder/oracle/classic/step_create_image.go b/builder/oracle/classic/step_create_image.go index f0aad257f..f55f89118 100644 --- a/builder/oracle/classic/step_create_image.go +++ b/builder/oracle/classic/step_create_image.go @@ -83,10 +83,10 @@ func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multi machineImageClient := client.MachineImages() createMI := &compute.CreateMachineImageInput{ // Two-part name of the account - Account: "/Compute-identity_domain/cloud_storage", + Account: fmt.Sprintf("/Compute-%s/cloud_storage", config.IdentityDomain), Description: "Packer generated TODO", // The three-part name of the object - Name: "/Compute-identity_domain/user/object", + Name: config.Identifier(s.imageName), // image_file.tar.gz, where image_file is the .tar.gz name of the machine image file that you have uploaded to Oracle Cloud Infrastructure Object Storage Classic. File: fmt.Sprintf("%s.tar.gz", s.imageName), } @@ -105,6 +105,8 @@ func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multi 4. Documentation 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() diff --git a/builder/oracle/classic/step_create_pv_builder.go b/builder/oracle/classic/step_create_pv_builder.go index 58dea543d..30f695a33 100644 --- a/builder/oracle/classic/step_create_pv_builder.go +++ b/builder/oracle/classic/step_create_pv_builder.go @@ -91,7 +91,6 @@ func (s *stepCreatePVBuilder) Cleanup(state multistep.StateBag) { state.Put("error", err) return } - // TODO wait for instance state to change to deleted? ui.Say("Terminated builder instance.") } diff --git a/builder/oracle/classic/step_create_pv_master.go b/builder/oracle/classic/step_create_pv_master.go index 29832a251..cffca9e55 100644 --- a/builder/oracle/classic/step_create_pv_master.go +++ b/builder/oracle/classic/step_create_pv_master.go @@ -92,6 +92,5 @@ func (s *stepCreatePVMaster) Cleanup(state multistep.StateBag) { state.Put("error", err) return } - // TODO wait for instance state to change to deleted? ui.Say("Terminated master instance.") }