Skip to content
Open
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 @@ -514,10 +514,10 @@ private List<Pipeline> getPipelines(ContainerKeyPrefix containerKeyPrefix)
}
List<Pipeline> pipelines = new ArrayList<>();
if (null != omKeyInfo) {
omKeyInfo.getKeyLocationVersions().stream().map(
omKeyInfo.getKeyLocationVersions().forEach(
omKeyLocationInfoGroup ->
omKeyLocationInfoGroup.getLocationList()
.stream().map(omKeyLocationInfo -> pipelines.add(
omKeyLocationInfoGroup.getLocationList().forEach(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its better, if we should de-duplicate the pipeline list here itself rather at the caller.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
omKeyLocationInfoGroup.getLocationList().forEach(
pipelines.addAll(
omKeyInfo.getKeyLocationVersions().stream()
.flatMap(g -> g.getLocationList().stream())
.map(OmKeyLocationInfo::getPipeline)
.collect(Collectors.toList()));

omKeyLocationInfo -> pipelines.add(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add the following assertions in our existing test here

ContainerMetadata cm = containerMap.get(containerId);                                                                                                                                                    
  assertNotNull(cm.getPipelines());                                                                                                                                                                        
  assertFalse(cm.getPipelines().isEmpty(),                                                                                                                                                                 
      "Pipelines list should be populated from OmKeyLocationInfo");                                                                                                                                        
  // If test data has known pipeline count, assert it exactly.        

omKeyLocationInfo.getPipeline())));
}
return pipelines;
Expand Down