This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 1446a6ce64323f85c34918a0662f5041ec6d5ec4 Author: Pasquale Congiusti <[email protected]> AuthorDate: Wed Jun 2 15:26:07 2021 +0200 doc(example): resource @path --- .../resource-configmap-location-route.groovy | 27 ++++++++++++++++++++++ .../resource-file-location-route.groovy | 25 ++++++++++++++++++++ .../resource-secret-location-route.groovy | 27 ++++++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/examples/user-config/resource-configmap-location-route.groovy b/examples/user-config/resource-configmap-location-route.groovy new file mode 100644 index 0000000..4714cc4 --- /dev/null +++ b/examples/user-config/resource-configmap-location-route.groovy @@ -0,0 +1,27 @@ +// camel-k: language=groovy +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// +// To run this integrations use: +// +// kubectl create configmap my-cm --from-literal=my-configmap-key="configmap content" +// kamel run --resource configmap:my-cm@/tmp/app/data resource-configmap-location-route.groovy --dev +// + +from('file:/tmp/app/data/?fileName=my-configmap-key&noop=true&idempotent=false') + .log('resource file content is: ${body}') diff --git a/examples/user-config/resource-file-location-route.groovy b/examples/user-config/resource-file-location-route.groovy new file mode 100644 index 0000000..ec59eb4 --- /dev/null +++ b/examples/user-config/resource-file-location-route.groovy @@ -0,0 +1,25 @@ +// camel-k: language=groovy +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// +// To run this integrations use: +// kamel run --resource file:resources-data.txt@/tmp/input.txt resource-file-location-route.groovy --dev +// + +from('file:/tmp/?fileName=input.txt&noop=true&idempotent=false') + .log('resource file content is: ${body}') diff --git a/examples/user-config/resource-secret-location-route.groovy b/examples/user-config/resource-secret-location-route.groovy new file mode 100644 index 0000000..747e7b2 --- /dev/null +++ b/examples/user-config/resource-secret-location-route.groovy @@ -0,0 +1,27 @@ +// camel-k: language=groovy +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// +// To run this integrations use: +// +// kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret" +// kamel run --resource secret:my-sec@/tmp/app/data resource-secret-location-route.groovy --dev +// + +from('file:/tmp/app/data/?fileName=my-secret-key&noop=true&idempotent=false') + .log('resource file content is: ${body}')
