aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject aries-containers git commit: Add DCOS support to Marathon impl.
Date Fri, 26 May 2017 13:38:36 GMT
Repository: aries-containers
Updated Branches:
  refs/heads/master 617302ed4 -> 81f6202bc


Add DCOS support to Marathon impl.


Project: http://git-wip-us.apache.org/repos/asf/aries-containers/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-containers/commit/81f6202b
Tree: http://git-wip-us.apache.org/repos/asf/aries-containers/tree/81f6202b
Diff: http://git-wip-us.apache.org/repos/asf/aries-containers/diff/81f6202b

Branch: refs/heads/master
Commit: 81f6202bc70be26538d3bccede1352b30e8a69fc
Parents: 617302e
Author: David Bosschaert <davidb@apache.org>
Authored: Fri May 26 14:38:19 2017 +0100
Committer: David Bosschaert <davidb@apache.org>
Committed: Fri May 26 14:38:19 2017 +0100

----------------------------------------------------------------------
 .../marathon/impl/MarathonContainerFactory.java         | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-containers/blob/81f6202b/containers-marathon/src/main/java/org/apache/aries/containers/marathon/impl/MarathonContainerFactory.java
----------------------------------------------------------------------
diff --git a/containers-marathon/src/main/java/org/apache/aries/containers/marathon/impl/MarathonContainerFactory.java
b/containers-marathon/src/main/java/org/apache/aries/containers/marathon/impl/MarathonContainerFactory.java
index c25f358..60321ba 100644
--- a/containers-marathon/src/main/java/org/apache/aries/containers/marathon/impl/MarathonContainerFactory.java
+++ b/containers-marathon/src/main/java/org/apache/aries/containers/marathon/impl/MarathonContainerFactory.java
@@ -27,6 +27,8 @@ import org.apache.aries.containers.ContainerFactory;
 import org.apache.aries.containers.Service;
 import org.apache.aries.containers.ServiceConfig;
 
+import mesosphere.dcos.client.DCOSClient;
+import mesosphere.dcos.client.model.DCOSAuthCredentials;
 import mesosphere.marathon.client.Marathon;
 import mesosphere.marathon.client.MarathonClient;
 import mesosphere.marathon.client.model.v2.App;
@@ -44,6 +46,16 @@ public class MarathonContainerFactory implements ContainerFactory {
         marathonClient = MarathonClient.getInstance(marathonURL);
     }
 
+    public MarathonContainerFactory(String marathonURL, String dcosUser, String passToken,
boolean serviceAcct) {
+        DCOSAuthCredentials authCredentials;
+        if (serviceAcct) {
+            authCredentials = DCOSAuthCredentials.forServiceAccount(dcosUser, passToken);
+        } else {
+            authCredentials = DCOSAuthCredentials.forUserAccount(dcosUser, passToken);
+        }
+        marathonClient = DCOSClient.getInstance(marathonURL, authCredentials);
+    }
+
     @Override
     public Service getService(ServiceConfig config) throws Exception {
         // TODO get existing service


Mime
View raw message