3030import java .util .LinkedList ;
3131import java .util .List ;
3232import java .util .Map ;
33+ import java .util .Optional ;
3334import java .util .concurrent .TimeUnit ;
3435import java .util .function .UnaryOperator ;
3536import org .apache .logging .log4j .LogManager ;
@@ -144,19 +145,13 @@ public void pull(ConnectionRole connectionRole) {
144145 labels .put (
145146 TlsImageLabels .CONNECTION_ROLE .getLabelName (),
146147 connectionRole .toString ().toLowerCase ());
147- Image image =
148- DOCKER .listImagesCmd ().withLabelFilter (labels ).exec ().stream ()
149- .findFirst ()
150- .orElseThrow (TlsVersionNotFoundException ::new );
151- if (image != null ) {
148+ Optional <Image > image =
149+ DOCKER .listImagesCmd ().withLabelFilter (labels ).exec ().stream ().findFirst ();
150+ if (image .isPresent ()) {
152151 LOGGER .warn ("Not pulling image, image already exists!" );
153152 return ;
154153 }
155154
156- // TODO: implement public docker repo when published
157- LOGGER .warn (
158- "Could not pull repository from Public Repository. Trying internal repository." );
159-
160155 String username = DockerClientManager .getDockerServerUsername ();
161156 String password = DockerClientManager .getDockerServerPassword ();
162157 if (username == null || password == null ) {
@@ -173,11 +168,11 @@ public void pull(ConnectionRole connectionRole) {
173168 // we go with this
174169 // for now
175170 String loginCommand =
176- "docker login -u "
177- + DockerClientManager .getDockerServerUsername ()
178- + " -p "
171+ "echo "
179172 + DockerClientManager .getDockerServerPassword ()
180- + " "
173+ + " | docker login -u "
174+ + DockerClientManager .getDockerServerUsername ()
175+ + " --password-stdin "
181176 + REPOSITORY_LOCATION ;
182177 String pullCommand =
183178 "docker pull "
0 commit comments