This commit is contained in:
Matthew Hooker 2018-10-24 14:49:09 -07:00
parent 6f729d0265
commit 86f6cf478a
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
2 changed files with 10 additions and 28 deletions

View File

@ -21,6 +21,11 @@ type PVConfig struct {
/* TODO:
some way to choose which connection to use for master
possible ignore everything for builder and always use SSH keys
* Documentation
* Configuration (master/builder images & entry, destination stuff, etc)
* Image entry for both master/builder
https://github.com/hashicorp/packer/issues/6833
* split master/builder image/connection config. i.e. build anything, master only linux
*/
}

View File

@ -27,43 +27,20 @@ func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multi
Description: "Packer generated TODO",
// The three-part name of the object
Name: config.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.
// 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: imageFile,
}
log.Printf("CreateMachineImageInput: %+v", createMI)
mi, err := machineImageClient.CreateMachineImage(createMI)
if err != nil {
err = fmt.Errorf("Error creating machine image: %s, %+v", err, mi)
err = fmt.Errorf("Error creating machine image: %s", err)
ui.Error(err.Error())
state.Put("error", err)
return multistep.ActionHalt
}
log.Printf("Registered machine image: %+v", mi)
log.Println("Registered machine image.")
state.Put("machine_image", mi.Name)
/*
Registered machine image: &{
Account:/Compute-ptstest/cloud_storage
Attributes:map[]
Audited:
Description:Packer generated TODO
ErrorReason: Hypervisor:map[mode:hvm]
ImageFormat:raw
File:mwhooker_test_1539898463.tar.gz
Name:mwhooker_test_1539898463
NoUpload:true
Platform:linux
Sizes:map[uploaded:5.79793509e+08 total:5.79793509e+08 decompressed:1.610612736e+10]
State:available
URI:https://api-z61.compute.us6.oraclecloud.com/machineimage/Compute-ptstest/mhooker%40hashicorp.com/mwhooker_test_1539898463
}
*/
/* TODO:
* Documentation
* Configuration (master/builder images & entry, destination stuff, etc)
* Image entry for both master/builder
https://github.com/hashicorp/packer/issues/6833
* split master/builder image/connection config. i.e. build anything, master only linux
*/
return multistep.ActionContinue
}