Skip to content

Commit

Permalink
Update version check in PluginInfo for semver range to make it compat…
Browse files Browse the repository at this point in the history
…ible with V_2_13_0

Signed-off-by: Abhilasha Seth <abseth@amazon.com>
  • Loading branch information
abseth-amzn committed Feb 9, 2024
1 parent 30c4210 commit 945387d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/plugins/PluginInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public PluginInfo(final StreamInput in) throws IOException {
this.name = in.readString();
this.description = in.readString();
this.version = in.readString();
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_13_0)) {
this.opensearchVersionRanges = (List<SemverRange>) in.readGenericValue();
} else {
this.opensearchVersionRanges = List.of(new SemverRange(in.readVersion(), SemverRange.RangeOperator.DEFAULT));
Expand All @@ -216,7 +216,7 @@ public void writeTo(final StreamOutput out) throws IOException {
out.writeString(name);
out.writeString(description);
out.writeString(version);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_13_0)) {
out.writeGenericValue(opensearchVersionRanges);
} else {
/*
Expand Down

0 comments on commit 945387d

Please sign in to comment.