Skip to content

Commit 19f8cd6

Browse files
author
isacc
committed
[fix] flink cluster node update
1 parent 278f06f commit 19f8cd6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/com/github/codingdebugallday/client/api/dto/NodeSettingInfo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ public class NodeSettingInfo {
2222
private String host;
2323
private String username;
2424
private String password;
25+
/**
26+
* 是否需要修改该节点的密码
27+
*/
28+
@Builder.Default
29+
private Boolean changePassword = false;
2530
}

src/main/java/com/github/codingdebugallday/client/app/service/impl/ClusterServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ private List<Node> genNodeList(ClusterDTO clusterDTO) {
213213
nodeDTO.setClusterCode(clusterDTO.getClusterCode());
214214
nodeDTO.setTenantId(clusterDTO.getTenantId());
215215
NodeSettingInfo nodeSettingInfo = JSON.toObj(nodeDTO.getSettingInfo(), NodeSettingInfo.class);
216-
nodeSettingInfo.setPassword(jasyptStringEncryptor.encrypt(nodeSettingInfo.getPassword()));
216+
// 第一次新增时对密码进行加密 或者 该节点需要对密码进行更新
217+
if (Objects.isNull(nodeDTO.getNodeId()) ||
218+
nodeSettingInfo.getChangePassword()) {
219+
nodeSettingInfo.setPassword(jasyptStringEncryptor.encrypt(nodeSettingInfo.getPassword()));
220+
}
217221
nodeDTO.setSettingInfo(JSON.toJson(nodeSettingInfo));
218222
return NodeConvertMapper.INSTANCE.dtoToEntity(nodeDTO);
219223
}).collect(Collectors.toList());

0 commit comments

Comments
 (0)