From b8dde5d3161f08a4ce3efd4197e6d5587935815e Mon Sep 17 00:00:00 2001 From: Kurt Stam Date: Wed, 8 Jun 2016 23:47:40 -0400 Subject: [PATCH] Switch to apiman.io annotation #349 --- .../main/java/io/fabric8/apiman/Kubernetes2ApimanMapper.java | 2 +- .../java/io/fabric8/apiman/rest/Kubernetes2ApimanFilter.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apiman/src/main/java/io/fabric8/apiman/Kubernetes2ApimanMapper.java b/apiman/src/main/java/io/fabric8/apiman/Kubernetes2ApimanMapper.java index cd6d14f..1b53a41 100644 --- a/apiman/src/main/java/io/fabric8/apiman/Kubernetes2ApimanMapper.java +++ b/apiman/src/main/java/io/fabric8/apiman/Kubernetes2ApimanMapper.java @@ -53,7 +53,7 @@ public AvailableApiBean createAvailableApiBean(Service service, Map annotations = service.getMetadata().getAnnotations(); String port = ""; - if (service.getSpec().getPorts().size() > 0) port = String.valueOf(service.getSpec().getPorts().get(0).getPort()); + if (service.getSpec().getPorts().size() > 0) port = String.valueOf(service.getSpec().getPorts().get(0).getTargetPort().getIntVal()); String scheme = "http"; if (annotations!=null && annotations.containsKey(SERVICE_SCHEME)) { scheme = annotations.get(SERVICE_SCHEME); diff --git a/apiman/src/main/java/io/fabric8/apiman/rest/Kubernetes2ApimanFilter.java b/apiman/src/main/java/io/fabric8/apiman/rest/Kubernetes2ApimanFilter.java index 949e7ce..b31b4c2 100644 --- a/apiman/src/main/java/io/fabric8/apiman/rest/Kubernetes2ApimanFilter.java +++ b/apiman/src/main/java/io/fabric8/apiman/rest/Kubernetes2ApimanFilter.java @@ -372,8 +372,8 @@ private boolean isServiceReady(AvailableApiBean bean) { private boolean isServiceRegisterToApiman(Service service) { Map annotations = service.getMetadata().getAnnotations(); - if (annotations!=null && annotations.containsKey(OPENSHIFT_API_MANAGER)) { - return "apiman".equalsIgnoreCase(annotations.get(OPENSHIFT_API_MANAGER)); + if (annotations!=null && annotations.containsKey(APIMAN_PUBLISH)) { + return true; } return false; }