Skip to content

Commit

Permalink
fix(trait): execute GC only in running phases
Browse files Browse the repository at this point in the history
This is required as many resource are not available in the Initialization phase, therefore may be removed even when they are expected to be instead updated (by Deployer trait).

Closes #5874
  • Loading branch information
squakez committed Oct 10, 2024
1 parent 03b38b9 commit b594c39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/trait/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ func (t *gcTrait) Configure(e *Environment) (bool, *TraitCondition, error) {
return false, NewIntegrationConditionUserDisabled("GC"), nil
}

return e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases(), nil, nil
// We need to execute this trait only when all resources have been created and
// deployed with a new generation if there is was any change during the Integration drift.
return e.IntegrationInRunningPhases(), nil, nil
}

func (t *gcTrait) Apply(e *Environment) error {
Expand Down

0 comments on commit b594c39

Please sign in to comment.