Skip to content

Commit

Permalink
fix(provider/cf): getClusters NAMES_ONLY shouldn't fully hydrate (#4749)
Browse files Browse the repository at this point in the history
Co-authored-by: Zach Smith <zachsmith@Zachs-MBP-2.attlocal.net>
  • Loading branch information
zachsmith1 and Zach Smith committed Jul 17, 2020
1 parent 3b85259 commit bc0acc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private CloudFoundryCluster clusterFromCacheData(CacheData clusterData, Detail d
CloudFoundryCluster cluster =
objectMapper.convertValue(
clusterData.getAttributes().get("resource"), CloudFoundryCluster.class);
if (detail.equals(Detail.NONE)) {
if (detail.equals(Detail.NONE) || detail.equals(Detail.NAMES_ONLY)) {
return cluster.withServerGroups(emptySet());
}
return cluster.withServerGroups(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,7 @@ void findCluster() {
});

assertThat(repo.findClusterByKey(clusterKey, NAMES_ONLY))
.hasValueSatisfying(
cluster ->
assertThat(cluster.getServerGroups())
.hasOnlyOneElementSatisfying(
serverGroup -> {
assertThat(serverGroup.getLoadBalancers()).isEmpty();
assertThat(serverGroup.getInstances()).isNotEmpty();
}));
.hasValueSatisfying(cluster -> assertThat(cluster.getServerGroups()).isEmpty());
}

@Test
Expand Down

0 comments on commit bc0acc2

Please sign in to comment.