SteNicholas commented on code in PR #162:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/162#discussion_r852713585
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/DefaultValidator.java:
##########
@@ -56,12 +57,17 @@ public class DefaultValidator implements
FlinkResourceValidator {
private static final Set<String> ALLOWED_LOG_CONF_KEYS =
Set.of(Constants.CONFIG_FILE_LOG4J_NAME,
Constants.CONFIG_FILE_LOGBACK_NAME);
- private static Configuration defaultFlinkConf =
+ @VisibleForTesting
+ static Configuration defaultFlinkConf =
FlinkUtils.loadConfiguration(EnvUtils.get(EnvUtils.ENV_FLINK_CONF_DIR));
@Override
public Optional<String> validateDeployment(FlinkDeployment deployment) {
FlinkDeploymentSpec spec = deployment.getSpec();
+ Map<String, String> effectiveConfig = defaultFlinkConf.toMap();
+ if (spec.getFlinkConfiguration() != null) {
+ effectiveConfig.putAll(spec.getFlinkConfiguration());
+ }
return firstPresent(
validateFlinkVersion(spec.getFlinkVersion()),
validateFlinkConfig(spec.getFlinkConfiguration()),
Review Comment:
@bgeng777, I don't think `spec.getFlinkConfiguration()` should be replaced
with `effectiveConfig`. The validation of Flink config validates the
user-defined configuration. Validating the `effectiveConfig` which merges the
default config and user-defined config is unnecessary.
--
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]