Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
fix revisionHistoryLimit is not exist (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
JameKeal authored Aug 22, 2022
1 parent c5cabf9 commit 69c860f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/yurtappmanager/controller/uniteddeployment/revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ func (r *ReconcileUnitedDeployment) constructUnitedDeploymentRevisions(ud *appsa
func (r *ReconcileUnitedDeployment) cleanExpiredRevision(ud *appsalphav1.UnitedDeployment,
sortedRevisions *[]*apps.ControllerRevision) (*[]*apps.ControllerRevision, error) {

exceedNum := len(*sortedRevisions) - int(*ud.Spec.RevisionHistoryLimit)
var revisionHistoryLimit int
if ud.Spec.RevisionHistoryLimit != nil {
revisionHistoryLimit = int(*ud.Spec.RevisionHistoryLimit)
}
exceedNum := len(*sortedRevisions) - revisionHistoryLimit
if exceedNum <= 0 {
return sortedRevisions, nil
}
Expand Down

0 comments on commit 69c860f

Please sign in to comment.