brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geom...@apache.org
Subject [2/4] brooklyn-server git commit: Updated oauth token to also accept from auth provider section
Date Thu, 06 Jul 2017 08:55:46 GMT
Updated oauth token to also accept from auth provider section


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8b916084
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8b916084
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8b916084

Branch: refs/heads/master
Commit: 8b916084cefbf66e18827bb5c4230f6749dfbb4a
Parents: ba90504
Author: Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
Authored: Mon Jun 5 17:05:56 2017 +0100
Committer: Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
Committed: Thu Jun 29 16:50:43 2017 +0100

----------------------------------------------------------------------
 .../kubernetes/KubernetesClientRegistryImpl.java    | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8b916084/locations/container/src/main/java/org/apache/brooklyn/container/location/kubernetes/KubernetesClientRegistryImpl.java
----------------------------------------------------------------------
diff --git a/locations/container/src/main/java/org/apache/brooklyn/container/location/kubernetes/KubernetesClientRegistryImpl.java
b/locations/container/src/main/java/org/apache/brooklyn/container/location/kubernetes/KubernetesClientRegistryImpl.java
index 6563fbf..c21e1cb 100644
--- a/locations/container/src/main/java/org/apache/brooklyn/container/location/kubernetes/KubernetesClientRegistryImpl.java
+++ b/locations/container/src/main/java/org/apache/brooklyn/container/location/kubernetes/KubernetesClientRegistryImpl.java
@@ -73,7 +73,7 @@ public class KubernetesClientRegistryImpl implements KubernetesClientRegistry
{
                     throw new IllegalStateException(String.format("Context %s not found",
currentContext));
                 }
                 Context context = foundContext.get().getContext();
-                LOG.warn("Context {} additional properties: {}", currentContext, context.getAdditionalProperties());
+                LOG.debug("Context {} additional properties: {}", currentContext, context.getAdditionalProperties());
                 configBuilder.withNamespace(context.getNamespace());
 
                 String user = context.getUser();
@@ -82,10 +82,16 @@ public class KubernetesClientRegistryImpl implements KubernetesClientRegistry
{
                     throw new IllegalStateException(String.format("Auth info %s not found",
user));
                 }
                 AuthInfo auth = foundAuthInfo.get().getUser();
-                LOG.warn("Auth info {} additional properties: {}", user, auth.getAdditionalProperties());
+                LOG.debug("Auth info {} additional properties: {}", user, auth.getAdditionalProperties());
                 configBuilder.withUsername(auth.getUsername());
                 configBuilder.withPassword(auth.getPassword());
-                configBuilder.withOauthToken(auth.getToken());
+                if (auth.getToken() == null) {
+                    if (auth.getAuthProvider() != null) {
+                        configBuilder.withOauthToken(auth.getAuthProvider().getConfig().get("id-token"));
+                    }
+                } else {
+                    configBuilder.withOauthToken(auth.getToken());
+                }
                 configBuilder.withClientCertFile(getRelativeFile(auth.getClientCertificate(),
configFolder));
                 configBuilder.withClientCertData(auth.getClientCertificateData());
                 configBuilder.withClientKeyFile(getRelativeFile(auth.getClientKey(), configFolder));
@@ -102,8 +108,8 @@ public class KubernetesClientRegistryImpl implements KubernetesClientRegistry
{
                 configBuilder.withCaCertData(cluster.getCertificateAuthorityData());
                 configBuilder.withApiVersion(Optional.fromNullable(cluster.getApiVersion()).or("v1"));
                 configBuilder.withTrustCerts(Boolean.TRUE.equals(cluster.getInsecureSkipTlsVerify()));
-                LOG.warn("Cluster {} server: {}", clusterName, cluster.getServer());
-                LOG.warn("Cluster {} additional properties: {}", clusterName, cluster.getAdditionalProperties());
+                LOG.debug("Cluster {} server: {}", clusterName, cluster.getServer());
+                LOG.debug("Cluster {} additional properties: {}", clusterName, cluster.getAdditionalProperties());
             } catch (IOException e) {
                 Exceptions.propagate(e);
             }


Mime
View raw message