Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
7d1db44c
Commit
7d1db44c
authored
Sep 05, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon: clean up UI output for spot instances a bit
parent
2e5f3da5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
builder/amazon/common/step_run_source_instance.go
builder/amazon/common/step_run_source_instance.go
+7
-1
builder/amazon/ebs/step_stop_instance.go
builder/amazon/ebs/step_stop_instance.go
+0
-1
No files found.
builder/amazon/common/step_run_source_instance.go
View file @
7d1db44c
...
@@ -93,6 +93,10 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
...
@@ -93,6 +93,10 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
}
}
instanceId
=
[]
string
{
runResp
.
Instances
[
0
]
.
InstanceId
}
instanceId
=
[]
string
{
runResp
.
Instances
[
0
]
.
InstanceId
}
}
else
{
}
else
{
ui
.
Message
(
fmt
.
Sprintf
(
"Requesting spot instance '%s' for: %s"
,
s
.
InstanceType
,
s
.
SpotPrice
))
runOpts
:=
&
ec2
.
RequestSpotInstances
{
runOpts
:=
&
ec2
.
RequestSpotInstances
{
SpotPrice
:
s
.
SpotPrice
,
SpotPrice
:
s
.
SpotPrice
,
KeyName
:
keyName
,
KeyName
:
keyName
,
...
@@ -113,9 +117,11 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
...
@@ -113,9 +117,11 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
s
.
spotRequest
=
&
runSpotResp
.
SpotRequestResults
[
0
]
s
.
spotRequest
=
&
runSpotResp
.
SpotRequestResults
[
0
]
spotRequestId
:=
s
.
spotRequest
.
SpotRequestId
spotRequestId
:=
s
.
spotRequest
.
SpotRequestId
ui
.
Say
(
fmt
.
Sprintf
(
"Waiting for spot request (%s) to become ready
..."
,
spotRequestId
))
ui
.
Message
(
fmt
.
Sprintf
(
"Waiting for spot request (%s) to become active
..."
,
spotRequestId
))
stateChange
:=
StateChangeConf
{
stateChange
:=
StateChangeConf
{
Pending
:
[]
string
{
"open"
},
Pending
:
[]
string
{
"open"
},
Target
:
"active"
,
Target
:
"active"
,
...
...
builder/amazon/ebs/step_stop_instance.go
View file @
7d1db44c
...
@@ -19,7 +19,6 @@ func (s *stepStopInstance) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -19,7 +19,6 @@ func (s *stepStopInstance) Run(state multistep.StateBag) multistep.StepAction {
// Skip when it is a spot instance
// Skip when it is a spot instance
if
s
.
SpotPrice
!=
""
{
if
s
.
SpotPrice
!=
""
{
ui
.
Say
(
fmt
.
Sprintf
(
"This is a spot instance, no need to stop for the AMI"
))
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment