@@ -942,6 +942,10 @@ private static Mono<SpaceResource> getOrganizationSpaceByName(CloudFoundryClient
942942 .onErrorResume (NoSuchElementException .class , t -> ExceptionUtils .illegalArgument ("Space %s not found" , space ));
943943 }
944944
945+ private static String getPassword (DockerCredentials dockerCredentials ) {
946+ return Optional .ofNullable (dockerCredentials ).map (DockerCredentials ::getPassword ).orElse (null );
947+ }
948+
945949 private static Flux <String > getPushRouteIdFromDomain (CloudFoundryClient cloudFoundryClient , List <DomainSummary > availableDomains , String domainId , ApplicationManifest manifest ,
946950 RandomWords randomWords , String spaceId ) {
947951 if (isTcpDomain (availableDomains , domainId )) {
@@ -1062,6 +1066,10 @@ private static Mono<String> getTcpRouteId(CloudFoundryClient cloudFoundryClient,
10621066 .map (ResourceUtils ::getId );
10631067 }
10641068
1069+ private static String getUsername (DockerCredentials dockerCredentials ) {
1070+ return Optional .ofNullable (dockerCredentials ).map (DockerCredentials ::getUsername ).orElse (null );
1071+ }
1072+
10651073 private static boolean isIdentical (String s , String t ) {
10661074 return Objects .equals (s , t );
10671075 }
@@ -1765,25 +1773,6 @@ private static Mono<ApplicationManifest> toApplicationManifest(SummaryApplicatio
17651773 .build ());
17661774 }
17671775
1768- private static Docker toDocker (SummaryApplicationResponse response ) {
1769- if (response .getDockerImage () == null ) {
1770- return null ;
1771- }
1772- return Docker .builder ()
1773- .image (response .getDockerImage ())
1774- .username (getUsername (response .getDockerCredentials ()))
1775- .password (getPassword (response .getDockerCredentials ()))
1776- .build ();
1777- }
1778-
1779- private static String getUsername (DockerCredentials dockerCredentials ) {
1780- return Optional .ofNullable (dockerCredentials ).map (DockerCredentials ::getUsername ).orElse (null );
1781- }
1782-
1783- private static String getPassword (DockerCredentials dockerCredentials ) {
1784- return Optional .ofNullable (dockerCredentials ).map (DockerCredentials ::getPassword ).orElse (null );
1785- }
1786-
17871776 private static ApplicationSummary toApplicationSummary (SpaceApplicationSummary spaceApplicationSummary ) {
17881777 return ApplicationSummary .builder ()
17891778 .diskQuota (spaceApplicationSummary .getDiskQuota ())
@@ -1805,6 +1794,17 @@ private static Date toDate(Double date) {
18051794 return date == null ? null : DateUtils .parseSecondsFromEpoch (date );
18061795 }
18071796
1797+ private static Docker toDocker (SummaryApplicationResponse response ) {
1798+ if (response .getDockerImage () == null ) {
1799+ return null ;
1800+ }
1801+ return Docker .builder ()
1802+ .image (response .getDockerImage ())
1803+ .username (getUsername (response .getDockerCredentials ()))
1804+ .password (getPassword (response .getDockerCredentials ()))
1805+ .build ();
1806+ }
1807+
18081808 private static DomainSummary toDomain (SharedDomainResource resource ) {
18091809 SharedDomainEntity entity = ResourceUtils .getEntity (resource );
18101810
0 commit comments