bgeng777 commented on code in PR #162:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/162#discussion_r852719363
##########
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:
I agree with your claim of dividing configs into default config and
user-defined config.
My point is that `validateFlinkConfig` actually is to verify if forbidden
configs like `KubernetesConfigOptions.NAMESPACE` and
`KubernetesConfigOptions.CLUSTER_ID` is defined. I think such validation should
be applied to default config as well.
--
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]