Skip to content

Commit 16a75f1

Browse files
authored
ES 9.0.2 & 8.17.7 support (#1119)
1 parent c09a74b commit 16a75f1

File tree

8 files changed

+13
-8
lines changed

8 files changed

+13
-8
lines changed

ci/supported-es-versions/es8x.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
8.18.2
22
8.18.1
33
8.18.0
4+
8.17.7
45
8.17.6
56
8.17.5
67
8.17.4

ci/supported-es-versions/es9x.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
9.0.2
12
9.0.1
23
9.0.0

es816x/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
latestSupportedEsVersion=8.17.6
1+
latestSupportedEsVersion=8.17.7

es90x/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
latestSupportedEsVersion=9.0.1
1+
latestSupportedEsVersion=9.0.2

ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/patches/Es818xPatch.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import just.semver.SemVer
2020
import tech.beshu.ror.tools.core.patches.base.TransportNetty4AwareEsPatch
2121
import tech.beshu.ror.tools.core.patches.internal.RorPluginDirectory
2222
import tech.beshu.ror.tools.core.patches.internal.filePatchers.*
23-
import tech.beshu.ror.tools.core.patches.internal.modifiers.NoOpFileModifier
2423
import tech.beshu.ror.tools.core.patches.internal.modifiers.bytecodeJars.*
2524
import tech.beshu.ror.tools.core.utils.EsUtil.es8182
2625

@@ -33,10 +32,9 @@ private[patches] class Es818xPatch(rorPluginDirectory: RorPluginDirectory, esVer
3332
new RepositoriesServiceAvailableForClusterServiceForAnyTypeOfNode(esVersion)
3433
),
3534
new EntitlementJarPatchCreator(
36-
new ModifyEntitlementInitializationClass(esVersion),
3735
esVersion match {
3836
case v if v >= es8182 => new ModifyFilesEntitlementsValidationClass(esVersion)
39-
case _ => NoOpFileModifier
37+
case _ => new ModifyEntitlementInitializationClass(esVersion)
4038
},
4139
ModifyEntitlementRuntimePolicyParserClass,
4240
),

ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/patches/Es90xPatch.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import tech.beshu.ror.tools.core.patches.base.TransportNetty4AwareEsPatch
2121
import tech.beshu.ror.tools.core.patches.internal.RorPluginDirectory
2222
import tech.beshu.ror.tools.core.patches.internal.filePatchers.*
2323
import tech.beshu.ror.tools.core.patches.internal.modifiers.bytecodeJars.*
24+
import tech.beshu.ror.tools.core.utils.EsUtil.es902
2425

2526
import scala.language.postfixOps
2627

@@ -31,7 +32,10 @@ private[patches] class Es90xPatch(rorPluginDirectory: RorPluginDirectory, esVers
3132
new RepositoriesServiceAvailableForClusterServiceForAnyTypeOfNode(esVersion)
3233
),
3334
new EntitlementJarPatchCreator(
34-
new ModifyEntitlementInitializationClass(esVersion),
35+
esVersion match {
36+
case v if v >= es902 => new ModifyFilesEntitlementsValidationClass(esVersion)
37+
case _ => new ModifyEntitlementInitializationClass(esVersion)
38+
},
3539
ModifyEntitlementRuntimePolicyParserClass,
3640
),
3741
new XPackCoreJarPatchCreator(

ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/patches/internal/modifiers/bytecodeJars/ModifyEntitlementInitializationClass.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ private[patches] class ModifyEntitlementInitializationClass(esVersion: SemVer)
5858
name match {
5959
case "validateReadFilesEntitlements" =>
6060
esVersion match
61-
case v if v >= es901 =>
61+
case v if v == es901 =>
6262
new DontValidateForbiddenPathsInCaseOfRorPlugin(
6363
super.visitMethod(access, name, descriptor, signature, exceptions)
6464
)
6565
case v if v == es8181 =>
6666
new DontValidateForbiddenPathsInCaseOfRorPlugin(
6767
super.visitMethod(access, name, descriptor, signature, exceptions)
6868
)
69-
case v =>
69+
case _ =>
7070
super.visitMethod(access, name, descriptor, signature, exceptions)
7171
case _ =>
7272
super.visitMethod(access, name, descriptor, signature, exceptions)

ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/utils/EsUtil.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ object EsUtil {
2323

2424
private val transportNetty4JarNameRegex = """^transport-netty4-(\d+\.\d+\.\d+(-[a-zA-Z0-9]+)?)\.jar$""".r
2525

26+
val es902: SemVer = SemVer.unsafeParse("9.0.2")
2627
val es901: SemVer = SemVer.unsafeParse("9.0.1")
2728
val es900: SemVer = SemVer.unsafeParse("9.0.0")
2829
val es8182: SemVer = SemVer.unsafeParse("8.18.2")

0 commit comments

Comments
 (0)