You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/04/21 22:39:49 UTC
[GitHub] [beam] aaltay commented on a change in pull request #14575: Adds --sdkContainerImage as new Java Dataflow PipelineOption
aaltay commented on a change in pull request #14575:
URL: https://github.com/apache/beam/pull/14575#discussion_r617936632
##########
File path: runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
##########
@@ -401,8 +402,34 @@ static boolean isServiceEndpoint(String endpoint) {
return Strings.isNullOrEmpty(endpoint) || Pattern.matches(ENDPOINT_REGEXP, endpoint);
}
+ static void validateSdkContainerImageOptions(DataflowPipelineWorkerPoolOptions workerOptions) {
+ // Check against null - empty string value for workerHarnessContainerImage
+ // must be preserved for legacy dataflowWorkerJar to work.
+ Preconditions.checkArgument(
+ workerOptions.getWorkerHarnessContainerImage() == null
+ || workerOptions.getSdkContainerImage() == null
+ || workerOptions
+ .getWorkerHarnessContainerImage()
+ .equals(workerOptions.getSdkContainerImage()),
+ "Cannot use legacy option workerHarnessContainerImage with sdkContainerImage. Prefer sdkContainerImage.");
+
+ // Make sure the values are the same for legacy flag and current flag.
+ if (workerOptions.getSdkContainerImage() != null) {
+ workerOptions.setWorkerHarnessContainerImage(workerOptions.getSdkContainerImage());
+ } else if (workerOptions.getWorkerHarnessContainerImage() != null) {
Review comment:
Would not this be always true since L418 set this option?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org