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 (opensearch-project#12273)

Signed-off-by: Abhilasha Seth <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
abseth-amzn authored and shiv0408 committed Apr 25, 2024
1 parent 6b7c58f commit 2cc5e56
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 2cc5e56

Please sign in to comment.