fix(kubernetes): fix image resolution for project clusters view
MODIFY
clouddriver-core/src/main/groovy/com/netflix/spinnaker/clouddriver/core/ProjectClustersService.java
clouddriver-core/src/main/groovy/com/netflix/spinnaker/clouddriver/core/ProjectClustersService.java
@@ -274,7 +274,17 @@ public class ProjectClustersService {
.findFirst();
new OptionalConsumer<>(
- (DeployedBuild b) -> b.deployed = Math.max(b.deployed, serverGroup.getCreatedTime()),
+ (DeployedBuild b) -> {
+ b.deployed = Math.max(b.deployed, serverGroup.getCreatedTime());
+ List images = getServerGroupBuildInfoImages(imageSummaries);
+ if (images != null) {
+ images.forEach(image -> {
+ if (image != null && !b.images.contains(image)) {
+ b.images.add(image);
+ }
+ });
+ }
+ },
() -> regionCluster.builds.add(new DeployedBuild(
buildInfo.host,
buildInfo.name,

MODIFY
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/caching/view/model/KubernetesV2ServerGroup.java
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/caching/view/model/KubernetesV2ServerGroup.java
@@ -50,6 +50,8 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
+import static java.util.Collections.singletonList;
+
@EqualsAndHashCode(callSuper = true)
@Data
@Slf4j
@@ -205,4 +207,46 @@ public class KubernetesV2ServerGroup extends ManifestBasedModel implements Serve
.isDisabled(isDisabled())
.build();
}
+
+ @Override
+ public ImagesSummary getImagesSummary() {
+ Map<String, Object> buildInfo = getBuildInfo();
+ Set<String> images = (HashSet<String>) buildInfo.get("images");
+ return new ImagesSummary() {
+ @Override
+ public List<? extends ImageSummary> getSummaries() {
+ return singletonList(
+ new ImageSummary() {
+
+ @Override
+ public String getServerGroupName() {
+ return getManifest().getName();
+ }
+
+ @Override
+ public String getImageId() {
+ return null;
+ }
+
+ @Override
+ public String getImageName() {
+ return null;
+ }
+
+ @Override
+ public Map<String, Object> getImage() {
+ return null;
+ }
+
+ @Override
+ public Map<String, Object> getBuildInfo() {
+ return new ImmutableMap.Builder<String, Object>()
+ .put("images", new ArrayList<>(images))
+ .build();
+ }
+ }
+ );
+ }
+ };
+ }
}

fix(kubernetes): fix image resolution for project clusters view (#3286)