Skip to content

Commit 510d29d

Browse files
committed
Ensure javaVer is prefixed and compared correctly
1 parent 7e50d92 commit 510d29d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

runners/google-cloud-dataflow-java/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,13 @@ tasks.register('examplesJavaRunnerV2IntegrationTestDistroless', Test.class) {
308308
tasks.register('buildAndPushDistrolessContainerImage', Task.class) {
309309
// Only Java 17 and 21 are supported.
310310
// See https://github.com/GoogleContainerTools/distroless/tree/main/java#image-contents.
311+
def javaVer = getSupportedJavaVersion()
312+
if(project.hasProperty('testJavaVersion')) {
313+
javaVer = "java${project.getProperty('testJavaVersion')}"
314+
}
311315
def allowed = ["java17", "java21"]
312316
doLast {
313-
def javaVer = project.findProperty('testJavaVersion')
314-
if (!allowed.contains(javaVer)) {
317+
if (!allowed.contains(javaVer)) {
315318
throw new GradleException("testJavaVersion must be one of ${allowed}, got: ${javaVer}")
316319
}
317320
if (!project.hasProperty('dockerTag')) {

0 commit comments

Comments
 (0)