Skip to content

Commit 4cdd593

Browse files
committed
Check version when serializing
Signed-off-by: Craig Perkins <cwperx@amazon.com>
1 parent 758b671 commit 4cdd593

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/main/java/org/opensearch/plugins/PluginInfo.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ public PluginInfo(final StreamInput in) throws IOException {
217217
this.customFolderName = in.readString();
218218
this.extendedPlugins = in.readStringList();
219219
this.hasNativeController = in.readBoolean();
220-
if (in.getVersion().onOrAfter(Version.V_2_18_0)) {
220+
// TODO switch this to 2.X version this change will be released in after backport
221+
if (in.getVersion().onOrAfter(Version.CURRENT)) {
221222
this.requestedActions = Settings.readSettingsFromStream(in);
222223
} else {
223224
this.requestedActions = Settings.EMPTY;
@@ -247,10 +248,8 @@ This works for currently supported range notations (=,~)
247248
}
248249
out.writeStringCollection(extendedPlugins);
249250
out.writeBoolean(hasNativeController);
250-
if (requestedActions != null) {
251+
if (out.getVersion().onOrAfter(Version.CURRENT)) {
251252
Settings.writeSettingsToStream(requestedActions, out);
252-
} else {
253-
Settings.writeSettingsToStream(Settings.EMPTY, out);
254253
}
255254
}
256255

0 commit comments

Comments
 (0)