Skip to content

Commit

Permalink
version 6 checks
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Apr 4, 2022
1 parent 6db1649 commit 4f049d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public boolean onOrBefore(Version version) {
public int compareMajor(Version other) {
// comparing Legacy 7x for bwc
// todo: remove the following when removing legacy support in 3.0.0
if (major == 7 || other.major == 7) {
if (major == 7 || other.major == 7 || major == 6 || other.major == 6) {
// opensearch v1.x and v2.x need major translation to compare w/ legacy versions
int m = major == 1 ? 7 : major == 2 ? 8 : major;
int om = other.major == 1 ? 7 : other.major == 2 ? 8 : other.major;
Expand Down Expand Up @@ -419,7 +419,7 @@ public boolean isCompatible(Version version) {
int a = major;
int b = version.major;

if (a == 7 || b == 7) {
if (a == 7 || b == 7 || a == 6 || b == 6) {
if (major <= 2) {
a += 6; // for legacy compatibility up to version 2.x (to compare minCompat)
}
Expand Down

0 comments on commit 4f049d8

Please sign in to comment.