Skip to content

Commit c7764d7

Browse files
authored
Extend context timeout for image saves (#42)
1 parent b1bab28 commit c7764d7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

builder/orka/step_create_image.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) mul
2323
ui := state.Get("ui").(packer.Ui)
2424
vmid := state.Get("vmid").(string)
2525
token := state.Get("token").(string)
26-
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
26+
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Hour)
2727

2828
defer cancel()
2929

@@ -41,6 +41,7 @@ func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) mul
4141
if config.ImagePrecopy {
4242
// If we are using the pre-copy logic, then we just re-commit the image back.
4343

44+
4445
ui.Say("Committing existing image since pre-copy is being used")
4546
ui.Say("Please wait as this can take a little while...")
4647

builder/orka/step_orka_create.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ func (s *stepOrkaCreate) Run(ctx context.Context, state multistep.StateBag) mult
6868
token, err := s.createOrkaToken(state)
6969

7070
if err != nil {
71-
ui.Error(fmt.Errorf("%s [%s]", OrkaAPIRequestErrorMessage, err).Error())
71+
e := fmt.Errorf("%s [%s]", OrkaAPIRequestErrorMessage, err)
72+
ui.Error(e.Error())
7273
state.Put("error", err)
7374
s.loginFailed = true
7475
return multistep.ActionHalt

0 commit comments

Comments
 (0)