feat(provider/cf): update the appsManagerUri to the specific serverGroup
MODIFY
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/Applications.java
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/Applications.java
@@ -216,9 +216,14 @@ public class Applications {
}
}
+ String serverGroupAppManagerUri = appsManagerUri;
+ if (StringUtils.isNotEmpty(appsManagerUri)){
+ serverGroupAppManagerUri = appsManagerUri + "/organizations/" + space.getOrganization().getId() + "/spaces/" + space.getId() + "/applications/" + application.getGuid();
+ }
+
return CloudFoundryServerGroup.builder()
.account(account)
- .appsManagerUri(appsManagerUri)
+ .appsManagerUri(serverGroupAppManagerUri)
.name(application.getName())
.id(application.getGuid())
.memory(process != null ? process.getMemoryInMb() : null)

MODIFY
clouddriver-cloudfoundry/src/test/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/ApplicationsTest.java
clouddriver-cloudfoundry/src/test/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/ApplicationsTest.java
@@ -126,7 +126,7 @@ class ApplicationsTest {
assertThat(cloudFoundryServerGroup).isNotNull();
assertThat(cloudFoundryServerGroup.getId()).isEqualTo("some-app-guid");
assertThat(cloudFoundryServerGroup.getName()).isEqualTo("some-app-name");
- assertThat(cloudFoundryServerGroup.getAppsManagerUri()).isEqualTo("some-apps-man-uri");
+ assertThat(cloudFoundryServerGroup.getAppsManagerUri()).isEqualTo("some-apps-man-uri/organizations/org-id/spaces/space-id/applications/some-app-guid");
assertThat(cloudFoundryServerGroup.getServiceInstances().size()).isEqualTo(1);
assertThat(cloudFoundryServerGroup.getServiceInstances().get(0).getTags()).containsExactly("tag1", "tag2");
}

feat(provider/cf): update the appsManagerUri to the specific serverGroup (#3192)