Skip to content

Commit

Permalink
Fix version check after backport (opensearch-project#14985)
Browse files Browse the repository at this point in the history
Signed-off-by: Mohit Godwani <[email protected]>
  • Loading branch information
mgodwan authored and wangdongyu.danny committed Aug 22, 2024
1 parent 4e0eb05 commit 436ece6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public ComposableIndexTemplate(StreamInput in) throws IOException {
this.version = in.readOptionalVLong();
this.metadata = in.readMap();
this.dataStreamTemplate = in.readOptionalWriteable(DataStreamTemplate::new);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
this.context = in.readOptionalWriteable(Context::new);
} else {
this.context = null;
Expand Down Expand Up @@ -248,7 +248,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalVLong(this.version);
out.writeMap(this.metadata);
out.writeOptionalWriteable(dataStreamTemplate);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
out.writeOptionalWriteable(context);
}
}
Expand Down

0 comments on commit 436ece6

Please sign in to comment.