Skip to content

Commit

Permalink
Correctly pick up on failed apply (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Kim <[email protected]>
  • Loading branch information
Oats87 authored Mar 8, 2022
1 parent 05d9e51 commit 00181cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/applyinator/applyinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ func (a *Applyinator) Apply(ctx context.Context, input ApplyInput) (ApplyOutput,
logrus.Debugf("[Applyinator] Executing instruction %d for plan %s", index, input.CalculatedPlan.Checksum)
executionInstructionDir := filepath.Join(executionDir, input.CalculatedPlan.Checksum+"_"+strconv.Itoa(index))
prefix := input.CalculatedPlan.Checksum + "_" + strconv.Itoa(index)
executeOutput, _, _, err := a.execute(ctx, prefix, executionInstructionDir, instruction.CommonInstruction, true)
if err != nil {
executeOutput, _, exitCode, err := a.execute(ctx, prefix, executionInstructionDir, instruction.CommonInstruction, true)
if err != nil || exitCode != 0 {
logrus.Errorf("error executing instruction %d: %v", index, err)
oneTimeApplySucceeded = false
}
Expand Down Expand Up @@ -270,7 +270,7 @@ func (a *Applyinator) Apply(ctx context.Context, input ApplyInput) (ApplyOutput,
executionInstructionDir := filepath.Join(executionDir, input.CalculatedPlan.Checksum+"_"+strconv.Itoa(index))
prefix := input.CalculatedPlan.Checksum + "_" + strconv.Itoa(index)
stdout, stderr, exitCode, err := a.execute(ctx, prefix, executionInstructionDir, instruction.CommonInstruction, false)
if err != nil {
if err != nil || exitCode != 0 {
periodicApplySucceeded = false
}
if instruction.Name == "" {
Expand Down

0 comments on commit 00181cd

Please sign in to comment.