summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2022-02-16 11:27:40 +0000
committerGerrit Code Review <gerrit@onap.org>2022-02-16 11:27:40 +0000
commitf17c64d91f74ec79f3472d2f903150576a6cbcef (patch)
tree9f598296f762adc91bd9b407096d3ed19ecd3991
parentd2ed26dbefa7ae3dffcddb427ced9d412fea2a8b (diff)
parent7c83aa47d1e5a4f4b925ed5aa15dea98b2db9547 (diff)
Merge "Disable the helm endpoints by default in clamp"
-rw-r--r--packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml7
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/controller/ChartController.java4
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml8
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/controlloop/participant/kubernetes/rest/ChartControllerTest.java4
4 files changed, 18 insertions, 5 deletions
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
index 3b0a97113..0d94e2e94 100644
--- a/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
+++ b/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
@@ -48,9 +48,14 @@ server:
logging:
# Configuration of logging
level:
- ROOT: INFO
+ ROOT: ERROR
org.springframework: ERROR
org.springframework.data: ERROR
org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+ org.onap.policy.clamp.controlloop.participant.kubernetes: INFO
file:
name: /var/log/onap/policy/clamp/application.log
+
+chart:
+ api:
+ enabled: false
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/controller/ChartController.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/controller/ChartController.java
index d041300a8..e2ccda4d5 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/controller/ChartController.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/controller/ChartController.java
@@ -1,6 +1,6 @@
/*-
* ========================LICENSE_START=================================
- * Copyright (C) 2021 Nordix Foundation. All rights reserved.
+ * Copyright (C) 2021-2022 Nordix Foundation. All rights reserved.
* ======================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ import org.onap.policy.clamp.controlloop.participant.kubernetes.service.ChartSer
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -48,6 +49,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController("chartController")
+@ConditionalOnExpression("${chart.api.enabled:false}")
@RequestMapping("helm")
@Api(tags = {"k8s-participant"})
public class ChartController {
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml
index 8b9d7e496..b266fe337 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml
+++ b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml
@@ -46,9 +46,15 @@ server:
logging:
# Configuration of logging
level:
- ROOT: INFO
+ ROOT: ERROR
org.springframework: ERROR
org.springframework.data: ERROR
org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+ org.onap.policy.clamp.controlloop.participant.kubernetes: INFO
+
file:
name: /var/log/onap/policy/clamp/application.log
+
+chart:
+ api:
+ enabled: false
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/controlloop/participant/kubernetes/rest/ChartControllerTest.java b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/controlloop/participant/kubernetes/rest/ChartControllerTest.java
index 2af2a0171..8048b19ce 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/controlloop/participant/kubernetes/rest/ChartControllerTest.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/controlloop/participant/kubernetes/rest/ChartControllerTest.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021-2022 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -61,7 +61,7 @@ import org.springframework.web.context.WebApplicationContext;
@ExtendWith(SpringExtension.class)
-@WebMvcTest(value = ChartController.class)
+@WebMvcTest(value = ChartController.class, properties = "chart.api.enabled=true")
@EnableConfigurationProperties(value = ParticipantK8sParameters.class)
class ChartControllerTest {