Skip to content

Commit acd999f

Browse files
Crumbyryanemerson
authored andcommitted
[#2492] Proper version comparison when deciding whether to use compare api
1 parent ec4434d commit acd999f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

controllers/cache_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ func configChanged(a, b string, i *v1.Infinispan, caches api.Caches, vm *version
669669
// If Operand is >= 14.0.7.Final we can use the cache compare endpoint to avoid unnecessary updates to the
670670
// Infinispan spec.template field
671671
operand, _ := vm.WithRef(i.Spec.Version)
672-
if operand.UpstreamVersion.Major >= 14 && operand.UpstreamVersion.Patch >= 7 {
672+
673+
if operand.UpstreamVersion.GE(constants.MinVersionCacheCompareEndpoint) {
673674
// Check if Cache configuration is semantically the same as that already present in the Cache CR
674675
equalConfig, err := caches.EqualConfiguration(a, b)
675676
if err != nil {

controllers/constants/constants.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ var (
5757
Minor: 0,
5858
Patch: 7,
5959
}
60+
61+
// 14.0.7.Final is required for ?action=compare endpoint
62+
MinVersionCacheCompareEndpoint = semver.Version{
63+
Major: 14,
64+
Minor: 0,
65+
Patch: 7,
66+
}
6067
)
6168

6269
const (

0 commit comments

Comments
 (0)