Hisoka-X commented on code in PR #6387:
URL: https://github.com/apache/seatunnel/pull/6387#discussion_r1561011921
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/command/ConfEncryptCommand.java:
##########
@@ -53,10 +56,19 @@ public void execute() throws CommandExecuteException,
ConfigCheckException {
checkConfigExist(configPath);
Config config =
ConfigFactory.parseFile(configPath.toFile())
-
.resolve(ConfigResolveOptions.defaults().setAllowUnresolved(true))
- .resolveWith(
- ConfigFactory.systemProperties(),
-
ConfigResolveOptions.defaults().setAllowUnresolved(true));
+
.resolve(ConfigResolveOptions.defaults().setAllowUnresolved(true));
+ if (abstractCommandArgs.variables != null) {
+ Map<String, String> map =
+ abstractCommandArgs.variables.stream()
+ .filter(Objects::nonNull)
+ .map(variable -> variable.split("=", 2))
+ .filter(pair -> pair.length == 2F)
+ .collect(Collectors.toMap(pair -> pair[0], pair ->
pair[1]));
+ config =
+ config.resolveWith(
+ ConfigFactory.parseMap(map),
Review Comment:
Why use parameter map as arg in here but
https://github.com/apache/seatunnel/pull/6387/files#diff-f4fa1a9b065718cc135d232712063b7b3a9135933396dd2674253da754d95c86R122
use system properties?
--
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]