From 6dd828008e1c553b5b4ac6e45af0ccf73c2ed92e Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 17 Dec 2019 11:10:37 -0500 Subject: [PATCH] Drop AUX cluster pod list from Platform status Change-Id: I797f104047aacfc1d3a5ee11c2a10e1a44ae06bb Signed-off-by: Lott, Christopher (cl778h) --- docs/release-notes.rst | 5 +++-- .../portal/dashboard/config/CaasIngressConfiguration.java | 14 +------------- .../portal/dashboard/controller/CaasIngressController.java | 13 +++---------- webapp-backend/src/main/resources/application.yaml | 4 ---- .../dashboard/config/CaasIngressMockConfiguration.java | 13 ------------- .../dashboard/controller/CaasIngressControllerTest.java | 12 ------------ .../src/test/resources/caas-ingress-ricaux-pods.json | 9 --------- webapp-frontend/src/app/platform/platform.component.html | 2 -- 8 files changed, 7 insertions(+), 65 deletions(-) delete mode 100644 webapp-backend/src/test/resources/caas-ingress-ricaux-pods.json diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 697f46e1..8ef088ea 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,11 +5,12 @@ RIC Dashboard Release Notes =========================== -Version 2.0.0, 2 Dec 2019 -------------------------- +Version 2.0.0, 22 Dec 2019 +-------------------------- * Change application properties file to YAML format * Add mock list of RIC instances to application properties * Add admin controller method to fetch list of RIC instances +* Drop AUX cluster container list fetched via CAAS Ingress Version 1.3.0, 26 Nov 2019 -------------------------- diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java index 43636796..dd9449dc 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java @@ -44,37 +44,25 @@ public class CaasIngressConfiguration { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // Populated by the autowired constructor - private final String caasIngressAuxUrl; private final String caasIngressPltUrl; @Autowired public CaasIngressConfiguration( // - @Value("${caasingress.aux.url.prefix}") final String auxUrlPrefix, // - @Value("${caasingress.aux.url.suffix}") final String auxUrlSuffix, // @Value("${caasingress.plt.url.prefix}") final String pltUrlPrefix, @Value("${caasingress.plt.url.suffix}") final String pltUrlSuffix, @Value("${caasingress.insecure}") final Boolean insecureFlag) // throws KeyManagementException, NoSuchAlgorithmException { - logger.debug("ctor caasingress aux prefix '{}' suffix '{}'", auxUrlPrefix, auxUrlSuffix); logger.debug("ctor caasingress plt prefix '{}' suffix '{}'", pltUrlPrefix, pltUrlSuffix); logger.debug("ctor caasingress insecure flag {}", insecureFlag); - caasIngressAuxUrl = new DefaultUriBuilderFactory(auxUrlPrefix.trim()).builder().path(auxUrlSuffix.trim()) - .build().normalize().toString(); caasIngressPltUrl = new DefaultUriBuilderFactory(pltUrlPrefix.trim()).builder().path(pltUrlSuffix.trim()) .build().normalize().toString(); - logger.info("Configuring CAAS-Ingress URLs: aux {}, plt {}", caasIngressAuxUrl, caasIngressPltUrl); + logger.info("Configuring CAAS-Ingress URL: plt {}", caasIngressPltUrl); if (insecureFlag != null && insecureFlag) { logger.warn("ctor: insecure flag set, disabling SSL checks"); HttpsURLConnectionUtils.turnOffSslChecking(); } } - @Bean - // The bean (method) name must be globally unique - public SimpleKubernetesClient ciAuxApi() { - return new SimpleKubernetesClient(caasIngressAuxUrl); - } - @Bean // The bean (method) name must be globally unique public SimpleKubernetesClient ciPltApi() { diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/CaasIngressController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/CaasIngressController.java index ad375f95..f8272b3f 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/CaasIngressController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/CaasIngressController.java @@ -64,22 +64,17 @@ public class CaasIngressController { public static final String PP_CLUSTER = "cluster"; public static final String PP_NAMESPACE = "namespace"; // Parameter values - public static final String CLUSTER_AUX = "aux"; public static final String CLUSTER_PLT = "plt"; public static final String CLUSTER_RIC = "ric"; // alternate for PLT - private final SimpleKubernetesClient ciAuxClient; private final SimpleKubernetesClient ciPltClient; @Autowired - public CaasIngressController(final SimpleKubernetesClient ciAuxApi, final SimpleKubernetesClient ciPltApi) { - Assert.notNull(ciAuxApi, "auxApi must not be null"); + public CaasIngressController(final SimpleKubernetesClient ciPltApi) { Assert.notNull(ciPltApi, "pltApi must not be null"); - this.ciAuxClient = ciAuxApi; this.ciPltClient = ciPltApi; if (logger.isDebugEnabled()) - logger.debug("ctor: configured with aux api {}, plt api {}", ciAuxClient.getClass().getName(), - ciPltClient.getClass().getName()); + logger.debug("ctor: configured with plt api {}", ciPltClient.getClass().getName()); } /* @@ -92,9 +87,7 @@ public class CaasIngressController { public String listPods(@PathVariable(PP_CLUSTER) String cluster, @PathVariable(PP_NAMESPACE) String namespace, HttpServletResponse response) { logger.debug("listPods: cluster {}, namespace {}", cluster, namespace); - if (CLUSTER_AUX.equalsIgnoreCase(cluster)) { - return ciAuxClient.listPods(namespace); - } else if (CLUSTER_PLT.equalsIgnoreCase(cluster) || CLUSTER_RIC.equalsIgnoreCase(cluster)) { + if (CLUSTER_PLT.equalsIgnoreCase(cluster) || CLUSTER_RIC.equalsIgnoreCase(cluster)) { return ciPltClient.listPods(namespace); } else { logger.warn("listPods: unknown cluster {}", cluster); diff --git a/webapp-backend/src/main/resources/application.yaml b/webapp-backend/src/main/resources/application.yaml index ae4bdee8..ab7ff6f0 100644 --- a/webapp-backend/src/main/resources/application.yaml +++ b/webapp-backend/src/main/resources/application.yaml @@ -69,10 +69,6 @@ e2mgr: caasingress: # Set insecure=true to disable SSL certificate and hostname checking insecure: true - aux: - url: - prefix: https://jar-app-props-default-caas-ingress-aux-URL - suffix: /api plt: url: prefix: https://jar-app-props-default-caas-ingress-plt-URL diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/CaasIngressMockConfiguration.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/CaasIngressMockConfiguration.java index bd94c2eb..56a01ab2 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/CaasIngressMockConfiguration.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/CaasIngressMockConfiguration.java @@ -50,13 +50,11 @@ public class CaasIngressMockConfiguration { @Value("${mock.config.delay:0}") private int delayMs; - private final String auxPods; private final String pltPods; public CaasIngressMockConfiguration() throws IOException { logger.info("Configuring mock CAAS-Ingres clients"); // Files in src/test/resources - auxPods = readDataFromPath("caas-ingress-ricaux-pods.json"); pltPods = readDataFromPath("caas-ingress-ricplt-pods.json"); } @@ -78,17 +76,6 @@ public class CaasIngressMockConfiguration { return sb.toString(); } - @Bean - // Use the same name as regular configuration - public SimpleKubernetesClient ciAuxApi() throws IOException { - SimpleKubernetesClient mockClient = mock(SimpleKubernetesClient.class); - doAnswer(inv -> { - logger.debug("listPods for aux"); - return auxPods; - }).when(mockClient).listPods("ricaux"); - return mockClient; - } - @Bean // Use the same name as regular configuration public SimpleKubernetesClient ciPltApi() throws IOException { diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/CaasIngressControllerTest.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/CaasIngressControllerTest.java index 2292b9ca..41dfcaf8 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/CaasIngressControllerTest.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/CaasIngressControllerTest.java @@ -32,18 +32,6 @@ public class CaasIngressControllerTest extends AbstractControllerTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - @Test - public void auxTest() { - final String nsAux = "ricaux"; - URI uri = buildUri(null, CaasIngressController.CONTROLLER_PATH, CaasIngressController.PODS_METHOD, - CaasIngressController.PP_CLUSTER, CaasIngressController.CLUSTER_AUX, CaasIngressController.PP_NAMESPACE, - nsAux); - logger.info("Invoking {}", uri); - String s = testRestTemplateStandardRole().getForObject(uri, String.class); - Assertions.assertFalse(s.isEmpty()); - Assertions.assertTrue(s.contains(nsAux)); - } - @Test public void pltTest() { final String nsPlt = "ricplt"; diff --git a/webapp-backend/src/test/resources/caas-ingress-ricaux-pods.json b/webapp-backend/src/test/resources/caas-ingress-ricaux-pods.json deleted file mode 100644 index 216b7dba..00000000 --- a/webapp-backend/src/test/resources/caas-ingress-ricaux-pods.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "kind": "PodList", - "apiVersion": "v1", - "metadata": { - "selfLink": "/api/v1/namespaces/ricaux/pods", - "resourceVersion": "1594484" - }, - "items": [] -} diff --git a/webapp-frontend/src/app/platform/platform.component.html b/webapp-frontend/src/app/platform/platform.component.html index c4b4666c..b28eb0d7 100644 --- a/webapp-frontend/src/app/platform/platform.component.html +++ b/webapp-frontend/src/app/platform/platform.component.html @@ -19,6 +19,4 @@ -->
-
-
-- 2.16.6