Skip to content

Commit

Permalink
Fix missing install_package state in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
upils committed Oct 9, 2023
1 parent f47b371 commit 0e6e016
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions internal/statemachine/classic_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,14 @@ func (stateMachine *StateMachine) calculateStates() error {
}
} else if classicStateMachine.ImageDef.Rootfs.Seed != nil {
rootfsCreationStates = append(rootfsCreationStates, rootfsSeedStates...)
if classicStateMachine.ImageDef.Customization != nil {
if len(classicStateMachine.ImageDef.Customization.ExtraPPAs) > 0 {
rootfsCreationStates = append(rootfsCreationStates,
[]stateFunc{
{"add_extra_ppas", (*StateMachine).addExtraPPAs},
{"install_packages", (*StateMachine).installPackages},
{"clean_extra_ppas", (*StateMachine).cleanExtraPPAs},
}...)
}
if classicStateMachine.ImageDef.Customization != nil && len(classicStateMachine.ImageDef.Customization.ExtraPPAs) > 0 {
rootfsCreationStates = append(rootfsCreationStates,
[]stateFunc{
{"add_extra_ppas", (*StateMachine).addExtraPPAs},
{"install_packages", (*StateMachine).installPackages},
{"clean_extra_ppas", (*StateMachine).cleanExtraPPAs},
}...)

} else {
rootfsCreationStates = append(rootfsCreationStates,
stateFunc{"install_packages", (*StateMachine).installPackages},
Expand Down

0 comments on commit 0e6e016

Please sign in to comment.