Skip to content

Commit

Permalink
fix: recover MAX_PLAIN_REVISION_COUNT (#7060)
Browse files Browse the repository at this point in the history
  • Loading branch information
free6om authored Apr 15, 2024
1 parent 7bb8896 commit 03a1264
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/rsm2/revision_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (

workloads "github.com/apecloud/kubeblocks/apis/workloads/v1alpha1"
"github.com/apecloud/kubeblocks/pkg/controller/model"
viper "github.com/apecloud/kubeblocks/pkg/viperx"
)

// ControllerRevisionHashLabel is the label used to indicate the hash value of a ControllerRevision's Data.
Expand Down Expand Up @@ -182,6 +183,10 @@ func getUpdateRevisions(revisions map[string]string) (map[string]string, error)
}

func buildUpdateRevisions(updateRevisions map[string]string) (map[string]string, error) {
maxPlainRevisionCount := viper.GetInt(MaxPlainRevisionCount)
if len(updateRevisions) <= maxPlainRevisionCount {
return updateRevisions, nil
}
revisionsJSON, err := json.Marshal(updateRevisions)
if err != nil {
return nil, err
Expand Down

0 comments on commit 03a1264

Please sign in to comment.