Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 容器执行灰度判断错误,导致主机执行的任务报错 #2978 #2981

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,6 @@ public class ExecuteTargetDTO implements Cloneable {
*/
private List<ExecuteObject> executeObjects;

public static ExecuteTargetDTO emptyInstance() {
ExecuteTargetDTO executeTargetDTO = new ExecuteTargetDTO();
executeTargetDTO.setIpList(Collections.emptyList());
executeTargetDTO.setDynamicServerGroups(Collections.emptyList());
executeTargetDTO.setStaticIpList(Collections.emptyList());
executeTargetDTO.setTopoNodes(Collections.emptyList());
executeTargetDTO.setStaticContainerList(Collections.emptyList());
return executeTargetDTO;
}

public ExecuteTargetDTO clone() {
ExecuteTargetDTO clone = new ExecuteTargetDTO();
clone.setVariable(variable);
Expand Down Expand Up @@ -617,6 +607,6 @@ private static List<KubeContainerFilter> convertToKubeContainerFilter(OpenApiExe
* 执行目标中是否包含容器执行对象
*/
public boolean hasContainerExecuteObject() {
return staticContainerList != null || containerFilters != null;
return CollectionUtils.isNotEmpty(staticContainerList) || CollectionUtils.isNotEmpty(containerFilters);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,12 @@ username, new AppResourceScope(appId), plan.getTaskTemplateId(),
whiteHostAllowActions);
authServers.merge(stepTargetServers);
if (!CollectionUtils.isEmpty(stepInstance.getFileSourceList())) {
stepInstance.getFileSourceList().stream().filter(fileSource -> !fileSource.isLocalUpload())
stepInstance.getFileSourceList().stream()
.filter(fileSource -> !fileSource.isLocalUpload())
.forEach(fileSource -> {
if (fileSource.getServers() == null) {
return;
}
ExecuteTargetDTO stepFileSourceServers = fileSource.getServers().clone();
filterHostsDoNotRequireAuth(ActionScopeEnum.FILE_DISTRIBUTION, stepFileSourceServers,
whiteHostAllowActions);
Expand Down Expand Up @@ -1500,7 +1504,6 @@ private void parseFileStepInstanceFromPlanStep(StepInstanceDTO stepInstance, Ser
fileSource.setFiles(fileList);
} else if (originFile.getFileType() == TaskFileTypeEnum.FILE_SOURCE.getType()) {
fileSource.setLocalUpload(false);
fileSource.setServers(ExecuteTargetDTO.emptyInstance());
// 文件源文件只需要fileSourceId与文件路径
List<FileDetailDTO> fileList = new ArrayList<>();
originFile.getFileLocation().forEach(fileLocation -> fileList.add(new FileDetailDTO(fileLocation)));
Expand Down
Loading