You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2022/12/19 15:23:05 UTC
[camel-karavan] 01/02: Health properties for Spring-boot
This is an automated email from the ASF dual-hosted git repository.
marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
commit 0c90cae9749d0c4da2ea8a2fd739d5cc58d4493d
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Mon Dec 19 10:07:11 2022 -0500
Health properties for Spring-boot
---
.../quarkus-openshift-application.properties | 2 +-
.../spring-boot-kubernetes-application.properties | 5 ++++
.../spring-boot-openshift-application.properties | 5 ++++
karavan-vscode/package.json | 29 ++++++++++++++++++++--
karavan-vscode/src/utils.ts | 8 ++++--
5 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/karavan-app/src/main/resources/snippets/quarkus-openshift-application.properties b/karavan-app/src/main/resources/snippets/quarkus-openshift-application.properties
index 3faada9..31de765 100644
--- a/karavan-app/src/main/resources/snippets/quarkus-openshift-application.properties
+++ b/karavan-app/src/main/resources/snippets/quarkus-openshift-application.properties
@@ -8,6 +8,6 @@ camel.jbang.dependencies=camel:microprofile-health,mvn:io.quarkus:quarkus-opensh
camel.health.enabled=true
camel.health.exposure-level=full
quarkus.container-image.name={projectId}
-quarkus.openshift.route.expose=false
+quarkus.openshift.route.expose=true
quarkus.openshift.part-of={projectId}
quarkus.openshift.replicas=1
\ No newline at end of file
diff --git a/karavan-app/src/main/resources/snippets/spring-boot-kubernetes-application.properties b/karavan-app/src/main/resources/snippets/spring-boot-kubernetes-application.properties
index 8bcef42..6a75791 100644
--- a/karavan-app/src/main/resources/snippets/spring-boot-kubernetes-application.properties
+++ b/karavan-app/src/main/resources/snippets/spring-boot-kubernetes-application.properties
@@ -6,6 +6,11 @@ camel.jbang.runtime=spring-boot
camel.jbang.dependencies=camel:microprofile-health
camel.health.enabled=true
camel.health.exposure-level=full
+management.endpoints.web.exposure.include=health
+management.health.probes.enabled=true
+management.health.livenessState.enabled=true
+management.health.readinessState.enabled=true
+management.endpoint.health.show-details=always
jkube.version=1.10.1
jkube.build.strategy=jib
jkube.imagePullPolicy=IfNotPresent
diff --git a/karavan-app/src/main/resources/snippets/spring-boot-openshift-application.properties b/karavan-app/src/main/resources/snippets/spring-boot-openshift-application.properties
index 29b302d..8d917d8 100644
--- a/karavan-app/src/main/resources/snippets/spring-boot-openshift-application.properties
+++ b/karavan-app/src/main/resources/snippets/spring-boot-openshift-application.properties
@@ -6,6 +6,11 @@ camel.jbang.runtime=spring-boot
camel.jbang.dependencies=camel:microprofile-health
camel.health.enabled=true
camel.health.exposure-level=full
+management.endpoints.web.exposure.include=health
+management.health.probes.enabled=true
+management.health.livenessState.enabled=true
+management.health.readinessState.enabled=true
+management.endpoint.health.show-details=always
jkube.version=1.10.1
jkube.build.strategy=jib
jkube.imagePullPolicy=IfNotPresent
diff --git a/karavan-vscode/package.json b/karavan-vscode/package.json
index de9d0ca..97bb49f 100644
--- a/karavan-vscode/package.json
+++ b/karavan-vscode/package.json
@@ -168,7 +168,7 @@
"scope": "machine",
"order": 70
},
- "Karavan.applicationProperties": {
+ "Karavan.quarkusApplicationProperties": {
"type": "array",
"uniqueItems": true,
"items": {
@@ -186,10 +186,35 @@
"camel.jbang.runtime=$RUNTIME",
"camel.jbang.exportDir=.export"
],
- "description": "application.properties template",
+ "description": "Quarkus application.properties template",
"scope": "machine",
"order": 90
},
+ "Karavan.springbootApplicationProperties": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "string"
+ },
+ "default": [
+ "camel.health.enabled=true",
+ "camel.health.exposure-level=full",
+ "camel.karavan.project-id=$NAME",
+ "camel.karavan.project-name=$NAME",
+ "camel.karavan.project-description=$NAME",
+ "camel.karavan.target=$TARGET",
+ "camel.jbang.gav=$GAV",
+ "camel.jbang.quarkusVersion=2.13.5.Final",
+ "camel.jbang.runtime=$RUNTIME",
+ "camel.jbang.exportDir=.export",
+ "management.endpoints.web.exposure.include=health",
+ "management.health.probes.enabled=true",
+ "management.endpoint.health.show-details=always"
+ ],
+ "description": "Spring-boot application.properties template",
+ "scope": "machine",
+ "order": 91
+ },
"Karavan.quarkusOpenshiftProperties": {
"type": "array",
"uniqueItems": true,
diff --git a/karavan-vscode/src/utils.ts b/karavan-vscode/src/utils.ts
index bec776a..136b6c7 100644
--- a/karavan-vscode/src/utils.ts
+++ b/karavan-vscode/src/utils.ts
@@ -300,8 +300,12 @@ export async function createApplicationproperties(runtime: string, gav: string,
const uriFolder: Uri = workspace.workspaceFolders[0].uri;
const name = currentFolderName() || "";
- const props: string[] = workspace.getConfiguration().get("Karavan.applicationProperties") || [];
- const runtimeProps: string[] = workspace.getConfiguration().get("Karavan.".concat(runtime.replaceAll("-", "")).concat(capitalize(target)).concat("Properties")) || [];
+ const runtimePrefix = runtime.replaceAll("-", "");
+ const appPropertyName = "Karavan.".concat(runtimePrefix).concat("ApplicationProperties");
+ const targetPropertyName = "Karavan.".concat(runtimePrefix).concat(capitalize(target)).concat("Properties");
+
+ const props: string[] = workspace.getConfiguration().get(appPropertyName) || [];
+ const runtimeProps: string[] = workspace.getConfiguration().get(targetPropertyName) || [];
const text = props.concat(runtimeProps).map(v => {
if (v.includes('$NAME')) return v.replace('$NAME', name)