fix identifier changes from oracle sdk
This commit is contained in:
parent
ab723eaf78
commit
c42be62d90
|
@ -17,7 +17,7 @@ func (s *stepAddKeysToAPI) Run(_ context.Context, state multistep.StateBag) mult
|
|||
// get variables from state
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
|
||||
if config.Comm.Type != "ssh" {
|
||||
ui.Say("Not using SSH communicator; skip generating SSH keys...")
|
||||
|
@ -61,7 +61,7 @@ func (s *stepAddKeysToAPI) Cleanup(state multistep.StateBag) {
|
|||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Deleting SSH keys...")
|
||||
deleteInput := compute.DeleteSSHKeyInput{Name: config.Comm.SSHKeyPairName}
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
deleteClient := client.SSHKeys()
|
||||
err := deleteClient.DeleteSSHKey(&deleteInput)
|
||||
if err != nil {
|
||||
|
|
|
@ -16,7 +16,7 @@ type stepAttachVolume struct {
|
|||
}
|
||||
|
||||
func (s *stepAttachVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
instanceInfo := state.Get(s.InstanceInfoKey).(*compute.InstanceInfo)
|
||||
|
||||
|
@ -46,7 +46,7 @@ func (s *stepAttachVolume) Cleanup(state multistep.StateBag) {
|
|||
if !ok {
|
||||
return
|
||||
}
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
saClient := client.StorageAttachments()
|
||||
|
|
|
@ -15,7 +15,7 @@ type stepCreateImage struct {
|
|||
|
||||
func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
config := state.Get("config").(*Config)
|
||||
imageFile := state.Get("image_file").(string)
|
||||
|
||||
|
@ -75,7 +75,7 @@ func (s *stepCreateImage) Cleanup(state multistep.StateBag) {
|
|||
return
|
||||
}
|
||||
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
config := state.Get("config").(*Config)
|
||||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
|
|
@ -17,7 +17,7 @@ func (s *stepCreateInstance) Run(_ context.Context, state multistep.StateBag) mu
|
|||
ui.Say("Creating Instance...")
|
||||
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ipAddName := state.Get("ipres_name").(string)
|
||||
secListName := state.Get("security_list").(string)
|
||||
|
||||
|
@ -63,7 +63,7 @@ func (s *stepCreateInstance) Cleanup(state multistep.StateBag) {
|
|||
|
||||
// terminate instance
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
config := state.Get("config").(*Config)
|
||||
|
||||
ui.Say("Terminating source instance...")
|
||||
|
|
|
@ -16,7 +16,7 @@ func (s *stepCreateIPReservation) Run(_ context.Context, state multistep.StateBa
|
|||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
iprClient := client.IPReservations()
|
||||
// TODO: add optional Name and Tags
|
||||
|
||||
|
@ -50,7 +50,7 @@ func (s *stepCreateIPReservation) Cleanup(state multistep.StateBag) {
|
|||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Cleaning up IP reservations...")
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
|
||||
input := compute.DeleteIPReservationInput{Name: ipResName.(string)}
|
||||
ipClient := client.IPReservations()
|
||||
|
|
|
@ -17,7 +17,7 @@ type stepCreatePersistentVolume struct {
|
|||
}
|
||||
|
||||
func (s *stepCreatePersistentVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Creating Volume...")
|
||||
|
@ -53,7 +53,7 @@ func (s *stepCreatePersistentVolume) Cleanup(state multistep.StateBag) {
|
|||
return
|
||||
}
|
||||
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Cleaning up Volume...")
|
||||
|
|
|
@ -21,7 +21,7 @@ func (s *stepCreatePVBuilder) Run(_ context.Context, state multistep.StateBag) m
|
|||
ui.Say("Creating builder instance...")
|
||||
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ipAddName := state.Get("ipres_name").(string)
|
||||
secListName := state.Get("security_list").(string)
|
||||
|
||||
|
@ -74,7 +74,7 @@ func (s *stepCreatePVBuilder) Cleanup(state multistep.StateBag) {
|
|||
|
||||
// terminate instance
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
|
||||
ui.Say("Terminating builder instance...")
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ func (s *stepCreatePVMaster) Run(_ context.Context, state multistep.StateBag) mu
|
|||
ui.Say("Creating master instance...")
|
||||
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ipAddName := state.Get("ipres_name").(string)
|
||||
secListName := state.Get("security_list").(string)
|
||||
|
||||
|
@ -75,7 +75,7 @@ func (s *stepCreatePVMaster) Cleanup(state multistep.StateBag) {
|
|||
|
||||
// terminate instance
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
|
||||
ui.Say("Terminating builder instance...")
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ func (s *stepListImages) Run(_ context.Context, state multistep.StateBag) multis
|
|||
// get variables from state
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ui.Say("Adding image to image list...")
|
||||
|
||||
imageListClient := client.ImageList()
|
||||
|
|
|
@ -27,7 +27,7 @@ func (s *stepSecurity) Run(_ context.Context, state multistep.StateBag) multiste
|
|||
|
||||
ui.Say(fmt.Sprintf("Configuring security lists and rules to enable %s access...", commType))
|
||||
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
runUUID := uuid.TimeOrderedUUID()
|
||||
|
||||
secListName := fmt.Sprintf("Packer_%s_Allow_%s_%s", commType, config.ImageName, runUUID)
|
||||
|
@ -108,7 +108,7 @@ func (s *stepSecurity) Cleanup(state multistep.StateBag) {
|
|||
return
|
||||
}
|
||||
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
config := state.Get("config").(*Config)
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multiste
|
|||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Creating Snapshot...")
|
||||
config := state.Get("config").(*Config)
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
instanceID := state.Get("instance_id").(string)
|
||||
|
||||
// get instances client
|
||||
|
@ -55,7 +55,7 @@ func (s *stepSnapshot) Cleanup(state multistep.StateBag) {
|
|||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Deleting Snapshot...")
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
snapClient := client.Snapshots()
|
||||
snapInput := compute.DeleteSnapshotInput{
|
||||
Snapshot: snap.Name,
|
||||
|
|
|
@ -17,7 +17,7 @@ func (s *stepTerminatePVMaster) Run(_ context.Context, state multistep.StateBag)
|
|||
ui := state.Get("ui").(packer.Ui)
|
||||
ui.Say("Deleting master Instance...")
|
||||
|
||||
client := state.Get("client").(*compute.ComputeClient)
|
||||
client := state.Get("client").(*compute.Client)
|
||||
instanceInfo := state.Get("master_instance_info").(*compute.InstanceInfo)
|
||||
|
||||
// get instances client
|
||||
|
|
Loading…
Reference in New Issue