semlanghi commented on code in PR #1337:
URL: https://github.com/apache/flink-agents/pull/1337#discussion_r4455981149


##########
runtime/src/main/java/org/apache/flink/agents/runtime/env/RemoteExecutionEnvironment.java:
##########
@@ -119,10 +127,34 @@ public static AgentConfiguration 
loadAgentConfiguration(String configDir) {
             if (configDir == null) {
                 return new AgentConfiguration();
             }
-            final Map<String, Object> configData =
-                    (Map<String, Object>)
-                            YamlParserUtils.loadYamlFile(new File(configDir, 
FLINK_CONF_FILENAME))
-                                    .getOrDefault("agent", new HashMap<>());
+            File configFile = new File(configDir, FLINK_CONF_FILENAME);
+            if (!configFile.exists()) {
+                File legacyConfigFile = new File(configDir, 
LEGACY_FLINK_CONF_FILENAME);
+                if (legacyConfigFile.exists()) {
+                    LOG.warn(
+                            "{} not found in {}, using legacy config file {}",
+                            FLINK_CONF_FILENAME,
+                            configDir,
+                            LEGACY_FLINK_CONF_FILENAME);
+                    configFile = legacyConfigFile;
+                }
+            }
+
+            final Map<String, Object> yaml = 
YamlParserUtils.loadYamlFile(configFile);

Review Comment:
   Sounds good @wenjin272 . to clarify one last point: this would imply that 
`agent:` blocks are supported only in `config.yaml` as the legacy parser (the 
one dedicated to `flink-conf`) does not support them.



-- 
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]

Reply via email to