You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/12/15 11:01:56 UTC
(camel-k-examples) branch main updated: fix: configmap is the only supported way
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 7b088df fix: configmap is the only supported way
7b088df is described below
commit 7b088df209a931d6837466db7c3944d7e3d8ffc0
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri Dec 15 12:00:10 2023 +0100
fix: configmap is the only supported way
---
generic-examples/openapi/README.md | 3 ++-
generic-examples/openapi/greetings.groovy | 7 ++++---
generic-examples/openapi/petstore.groovy | 6 ++++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/generic-examples/openapi/README.md b/generic-examples/openapi/README.md
index 1b846a2..7e26b0c 100644
--- a/generic-examples/openapi/README.md
+++ b/generic-examples/openapi/README.md
@@ -7,7 +7,8 @@ Find useful examples about how to expose an Open API specification in a Camel K
Deploy the examples running
```
-kamel run --dev --name greetings --open-api file:greetings-api.json greetings.groovy
+kubectl create configmap my-openapi --from-file=greetings-api.json
+kamel run --dev --name greetings --open-api configmap:my-openapi greetings.groovy
```
Then you can test by calling the hello endpoint, ie:
diff --git a/generic-examples/openapi/greetings.groovy b/generic-examples/openapi/greetings.groovy
index 90a09ce..511fb83 100644
--- a/generic-examples/openapi/greetings.groovy
+++ b/generic-examples/openapi/greetings.groovy
@@ -17,10 +17,11 @@
*/
//
-// kamel run --dev --name greetings --open-api greetings-api.json greetings.groovy
-//
+// kubectl create configmap my-openapi --from-file=greetings-api.json
+// kamel run --dev --name greetings --open-api configmap:my-openapi greetings.groovy
+//
from('direct:greeting-api')
- .to('log:api?showAll=true&multiline=true')
+ .to('log:api?showAll=true&multiline=true')
.setBody()
.simple('Hello from ${headers.name}')
diff --git a/generic-examples/openapi/petstore.groovy b/generic-examples/openapi/petstore.groovy
index e5221e1..8f90173 100644
--- a/generic-examples/openapi/petstore.groovy
+++ b/generic-examples/openapi/petstore.groovy
@@ -16,9 +16,11 @@
* limitations under the License.
*/
+
+//
+// kubectl create configmap my-petstore-api --from-file=petstore-api.yaml
+// kamel run --dev --name petstore --open-api configmap:my-petstore-api petstore.groovy
//
-// kamel run --dev --name petstore --open-api file:petstore-api.yaml petstore.groovy
-//
from('direct:listPets')
.log('listPets')