From 0a5ef0f01e27ab49e5c06a027b20f4d867d07201 Mon Sep 17 00:00:00 2001 From: Tako Schotanus Date: Thu, 9 Apr 2020 21:11:46 +0200 Subject: [PATCH] chore: added logging for debugging purposes --- .../service/openshift/impl/OpenShiftClusterRegistryImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/openshift-service-impl/src/main/java/io/fabric8/launcher/service/openshift/impl/OpenShiftClusterRegistryImpl.java b/services/openshift-service-impl/src/main/java/io/fabric8/launcher/service/openshift/impl/OpenShiftClusterRegistryImpl.java index cd62caaa0..1784bb195 100644 --- a/services/openshift-service-impl/src/main/java/io/fabric8/launcher/service/openshift/impl/OpenShiftClusterRegistryImpl.java +++ b/services/openshift-service-impl/src/main/java/io/fabric8/launcher/service/openshift/impl/OpenShiftClusterRegistryImpl.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Objects; import java.util.Set; +import java.util.logging.Logger; import javax.inject.Inject; import javax.inject.Singleton; @@ -40,6 +41,8 @@ public class OpenShiftClusterRegistryImpl implements OpenShiftClusterRegistry { private static final String SUBSCRIPTION_TOKEN = OpenShiftEnvironment.LAUNCHER_MISSIONCONTROL_OPENSHIFT_CLUSTERS_SUBSCRIPTION_TOKEN.value(); + private static final Logger log = Logger.getLogger(OpenShiftClusterRegistryImpl.class.getName()); + @Inject public OpenShiftClusterRegistryImpl(HttpClient httpClient) { this.httpClient = httpClient; @@ -101,6 +104,7 @@ public Set getClusters() { @Override public Set getSubscribedClusters(Principal principal) { + log.info("getSubscribedClusters principal=" + (principal != null ? principal.getName() : "null") + ", token=" + Objects.toString(SUBSCRIPTION_TOKEN)); if (SUBSCRIPTION_TOKEN == null || principal == null) { // Token does not exist or user is not authenticated, just return all clusters return getClusters(); @@ -111,6 +115,7 @@ public Set getSubscribedClusters(Principal principal) { Set clusterSet = new HashSet<>(); for (JsonNode subscription : tree.get("subscriptions")) { String clusterId = subscription.get("plan").get("name").asText(); + log.info("getSubscribedClusters clusterId=" + clusterId + ", present=" + Objects.toString(findClusterById(clusterId))); findClusterById(clusterId).ifPresent(clusterSet::add); } return clusterSet;