gyfora commented on a change in pull request #29:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/29#discussion_r816577823
##########
File path:
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/DefaultDeploymentValidator.java
##########
@@ -86,12 +87,26 @@
return Optional.empty();
}
- private Optional<String> validateJmSpec(JobManagerSpec jmSpec) {
+ private Optional<String> validateJmSpec(JobManagerSpec jmSpec, Map<String,
String> confMap) {
if (jmSpec == null) {
return Optional.empty();
}
- return validateResources("JobManager", jmSpec.getResource());
+ return firstPresent(
+ validateResources("JobManager", jmSpec.getResource()),
+ validateJmReplicas("JobManager", jmSpec.getReplicas(),
confMap));
+ }
+
+ private Optional<String> validateJmReplicas(
+ String component, int replicas, Map<String, String> confMap) {
+ if (!confMap.containsKey(HighAvailabilityOptions.HA_MODE.key()) &&
replicas != 1) {
Review comment:
you are right @wangyang0918 that would be a bit cleaner, we could push a
small fixup for this or include this in some followup work.
Sorry for merging this quickly
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]