From cbe6968f669b6b029d8915ce76bda834166a4330 Mon Sep 17 00:00:00 2001 From: juwei008 Date: Thu, 11 Apr 2024 13:40:37 +0800 Subject: [PATCH] Fix some YAML files and README.md documents still remain in v1beta1 format Starting from version v1.1.0, the core v1beta1 API is deprecated and will be removed in the future. However, in some YAML files and README.md documents, there are still remain in v1beta1 format. Fixes: #146 Signed-off-by: juwei008 --- apps/buildah/java/README.md | 4 ++-- functions/async/bindings/README.md | 4 ++-- functions/async/java/cron-input-kafka-output/README.md | 2 +- functions/async/java/pubsub/README.md | 2 +- .../async/logs-handler-function/logs-handler-function.yaml | 2 +- functions/async/pubsub/README.md | 2 +- functions/knative/hello-world-go/README.md | 4 ++-- functions/knative/hello-world-node/commonjs/README.md | 4 ++-- functions/knative/hello-world-node/esm/README.md | 4 ++-- functions/knative/java/cloudevent/README.md | 2 +- functions/knative/java/hello-world/README.md | 4 ++-- functions/knative/java/with-output-binding/README.md | 4 ++-- functions/knative/multiple-functions-go/README.md | 4 ++-- functions/knative/path-parameters-function-go/README.md | 4 ++-- functions/knative/with-output-binding/README.md | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apps/buildah/java/README.md b/apps/buildah/java/README.md index fcb5553..444dfaa 100644 --- a/apps/buildah/java/README.md +++ b/apps/buildah/java/README.md @@ -17,7 +17,7 @@ Follow [this guide](https://openfunction.dev/docs/getting-started/quickstarts/pr For sample function below, modify the ``spec.image`` field in ``sample-java-app.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: sample-java-app @@ -74,4 +74,4 @@ Access functions by the external address: ```shell curl http://sample-java-app.default.ofn.io ``` - \ No newline at end of file + diff --git a/functions/async/bindings/README.md b/functions/async/bindings/README.md index 8ca307e..becb97f 100644 --- a/functions/async/bindings/README.md +++ b/functions/async/bindings/README.md @@ -17,7 +17,7 @@ We will use the sample in the `cron-input` directory, which will be triggered by Modify the `spec.image` field in `cron-input/cron-input.yaml` to your own container registry address: ```yaml -apiVersion: core.openfunction.io/v1beta1 +apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: cron-input @@ -59,7 +59,7 @@ We will use the sample in the `cron-input-kafka-output` directory, which will be Modify the `spec.image` field in `cron-input-kafka-output/cron-input-kafka-output.yaml` to your own container registry address: ```yaml -apiVersion: core.openfunction.io/v1beta1 +apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: cron-input-kafka-output diff --git a/functions/async/java/cron-input-kafka-output/README.md b/functions/async/java/cron-input-kafka-output/README.md index 50d8f6f..0e3760c 100644 --- a/functions/async/java/cron-input-kafka-output/README.md +++ b/functions/async/java/cron-input-kafka-output/README.md @@ -15,7 +15,7 @@ The `cron-input-kafka-output-java` function will be triggered by Dapr's `binding Modify the `spec.image` field in `cron-input-kafka-output.yaml` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: cron-input-kafka-output-java diff --git a/functions/async/java/pubsub/README.md b/functions/async/java/pubsub/README.md index 07601d7..34c78e4 100644 --- a/functions/async/java/pubsub/README.md +++ b/functions/async/java/pubsub/README.md @@ -21,7 +21,7 @@ Follow [this guide](../../pubsub/README.md#Build-and-deploy-Producer) to deploy Modify the ``spec.image`` field in `function-subscribe.yaml` to your own container registry address: ```yaml -apiVersion: core.openfunction.io/v1beta1 +apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: autoscaling-subscriber-java diff --git a/functions/async/logs-handler-function/logs-handler-function.yaml b/functions/async/logs-handler-function/logs-handler-function.yaml index e55b600..530e882 100644 --- a/functions/async/logs-handler-function/logs-handler-function.yaml +++ b/functions/async/logs-handler-function/logs-handler-function.yaml @@ -3,7 +3,7 @@ kind: Function metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"core.openfunction.io/v1beta1","kind":"Function","metadata":{"annotations":{},"name":"logs-async-handler","namespace":"default"},"spec":{"build":{"builder":"openfunction/builder-go:latest","env":{"FUNC_CLEAR_SOURCE":"true","FUNC_NAME":"LogsHandler"},"srcRepo":{"revision":"main","sourceSubPath":"functions/async/logs-handler-function/","url":"https://github.com/OpenFunction/samples.git"}},"image":"openfunctiondev/logs-async-handler:v1","imageCredentials":{"name":"push-secret"},"serving":{"bindings":{"kafka-receiver":{"metadata":[{"name":"brokers","value":"kafka-server-kafka-brokers:9092"},{"name":"authRequired","value":"false"},{"name":"publishTopic","value":"logs"},{"name":"topics","value":"logs"},{"name":"consumerGroup","value":"logs-handler"}],"type":"bindings.kafka","version":"v1"},"notification-manager":{"metadata":[{"name":"url","value":"http://notification-manager-svc.kubesphere-monitoring-system.svc.cluster.local:19093/api/v2/alerts"}],"type":"bindings.http","version":"v1"}},"inputs":[{"component":"kafka-receiver","name":"kafka"}],"outputs":[{"component":"notification-manager","name":"notify","operation":"post"}],"runtime":"async","scaleOptions":{"keda":{"scaledObject":{"advanced":{"horizontalPodAutoscalerConfig":{"behavior":{"scaleDown":{"policies":[{"periodSeconds":15,"type":"Percent","value":50}],"stabilizationWindowSeconds":45},"scaleUp":{"stabilizationWindowSeconds":0}}}},"cooldownPeriod":60,"maxReplicaCount":10,"minReplicaCount":0,"pollingInterval":15}}},"template":{"containers":[{"imagePullPolicy":"IfNotPresent","name":"function"}]},"triggers":[{"metadata":{"bootstrapServers":"kafka-server-kafka-brokers.default.svc.cluster.local:9092","consumerGroup":"logs-handler","lagThreshold":"20","topic":"logs"},"type":"kafka"}]},"version":"v2.0.0"}} + {"apiVersion":"core.openfunction.io/v1beta2","kind":"Function","metadata":{"annotations":{},"name":"logs-async-handler","namespace":"default"},"spec":{"build":{"builder":"openfunction/builder-go:latest","env":{"FUNC_CLEAR_SOURCE":"true","FUNC_NAME":"LogsHandler"},"srcRepo":{"revision":"main","sourceSubPath":"functions/async/logs-handler-function/","url":"https://github.com/OpenFunction/samples.git"}},"image":"openfunctiondev/logs-async-handler:v1","imageCredentials":{"name":"push-secret"},"serving":{"bindings":{"kafka-receiver":{"metadata":[{"name":"brokers","value":"kafka-server-kafka-brokers:9092"},{"name":"authRequired","value":"false"},{"name":"publishTopic","value":"logs"},{"name":"topics","value":"logs"},{"name":"consumerGroup","value":"logs-handler"}],"type":"bindings.kafka","version":"v1"},"notification-manager":{"metadata":[{"name":"url","value":"http://notification-manager-svc.kubesphere-monitoring-system.svc.cluster.local:19093/api/v2/alerts"}],"type":"bindings.http","version":"v1"}},"inputs":[{"component":"kafka-receiver","name":"kafka"}],"outputs":[{"component":"notification-manager","name":"notify","operation":"post"}],"runtime":"async","scaleOptions":{"keda":{"scaledObject":{"advanced":{"horizontalPodAutoscalerConfig":{"behavior":{"scaleDown":{"policies":[{"periodSeconds":15,"type":"Percent","value":50}],"stabilizationWindowSeconds":45},"scaleUp":{"stabilizationWindowSeconds":0}}}},"cooldownPeriod":60,"maxReplicaCount":10,"minReplicaCount":0,"pollingInterval":15}}},"template":{"containers":[{"imagePullPolicy":"IfNotPresent","name":"function"}]},"triggers":[{"metadata":{"bootstrapServers":"kafka-server-kafka-brokers.default.svc.cluster.local:9092","consumerGroup":"logs-handler","lagThreshold":"20","topic":"logs"},"type":"kafka"}]},"version":"v2.0.0"}} creationTimestamp: "2023-05-19T02:19:38Z" generation: 1 name: logs-async-handler diff --git a/functions/async/pubsub/README.md b/functions/async/pubsub/README.md index 4392895..6010c62 100644 --- a/functions/async/pubsub/README.md +++ b/functions/async/pubsub/README.md @@ -54,7 +54,7 @@ kubectl apply -f deploy.yaml Modify the ``spec.image`` field in `subscriber/function-subscribe.yaml` to your own container registry address: ```yaml -apiVersion: core.openfunction.io/v1beta1 +apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: autoscaling-subscriber diff --git a/functions/knative/hello-world-go/README.md b/functions/knative/hello-world-go/README.md index 3e04caf..8ef6e03 100644 --- a/functions/knative/hello-world-go/README.md +++ b/functions/knative/hello-world-go/README.md @@ -47,7 +47,7 @@ You can create this secret by editing the ``REGISTRY_SERVER``, ``REGISTRY_USER`` For sample function below, modify the ``spec.image`` field in ``function-sample.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-sample @@ -142,4 +142,4 @@ You can create this secret by editing the ``REGISTRY_SERVER``, ``REGISTRY_USER`` curl http://serving-q6wdp-ksvc-wk6mv.default..sslip.io/OpenFunction Hello, OpenFunction! - ``` \ No newline at end of file + ``` diff --git a/functions/knative/hello-world-node/commonjs/README.md b/functions/knative/hello-world-node/commonjs/README.md index 5eadc52..72e5a63 100644 --- a/functions/knative/hello-world-node/commonjs/README.md +++ b/functions/knative/hello-world-node/commonjs/README.md @@ -8,7 +8,7 @@ You can define a common JavaScript Function as below: ```yaml -apiVersion: core.openfunction.io/v1beta1 +apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: node-sample @@ -33,4 +33,4 @@ spec: containers: - name: function # DO NOT change this imagePullPolicy: IfNotPresent -``` \ No newline at end of file +``` diff --git a/functions/knative/hello-world-node/esm/README.md b/functions/knative/hello-world-node/esm/README.md index bd99ddf..14f2cfd 100644 --- a/functions/knative/hello-world-node/esm/README.md +++ b/functions/knative/hello-world-node/esm/README.md @@ -12,7 +12,7 @@ OpenFunction Nodejs Functions Framework supports loading your function code as a You can define a ESM JavaScript Function as below: ```yaml -apiVersion: core.openfunction.io/v1beta1 +apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: node-sample @@ -37,4 +37,4 @@ spec: containers: - name: function # DO NOT change this imagePullPolicy: IfNotPresent -``` \ No newline at end of file +``` diff --git a/functions/knative/java/cloudevent/README.md b/functions/knative/java/cloudevent/README.md index b80b068..5484cc4 100644 --- a/functions/knative/java/cloudevent/README.md +++ b/functions/knative/java/cloudevent/README.md @@ -54,7 +54,7 @@ Follow [this guide](https://openfunction.dev/docs/getting-started/quickstarts/pr For sample function below, modify the ``spec.image`` field in ``function-sample.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-cloudevent-java diff --git a/functions/knative/java/hello-world/README.md b/functions/knative/java/hello-world/README.md index 00b5bda..1a517de 100644 --- a/functions/knative/java/hello-world/README.md +++ b/functions/knative/java/hello-world/README.md @@ -38,7 +38,7 @@ Follow [this guide](https://openfunction.dev/docs/getting-started/quickstarts/pr For sample function below, modify the ``spec.image`` field in ``function-sample.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-http-java @@ -97,4 +97,4 @@ Access functions by the external address: curl http://function-http-java.default.ofn.io Hello, World! ``` - \ No newline at end of file + diff --git a/functions/knative/java/with-output-binding/README.md b/functions/knative/java/with-output-binding/README.md index 93d48ea..328ee04 100644 --- a/functions/knative/java/with-output-binding/README.md +++ b/functions/knative/java/with-output-binding/README.md @@ -56,7 +56,7 @@ Use the following command to create the function: The function plugin mechanism is also demonstrated in `function-front`, and you can observe the following configuration in the definition of `function-front`. ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-front @@ -108,7 +108,7 @@ The custom content will send to the output named `target` in the `function-front For sample function below, modify the ``spec.image`` field in ``function-front.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-sample diff --git a/functions/knative/multiple-functions-go/README.md b/functions/knative/multiple-functions-go/README.md index b2f181c..ca35404 100644 --- a/functions/knative/multiple-functions-go/README.md +++ b/functions/knative/multiple-functions-go/README.md @@ -51,7 +51,7 @@ You can create this secret by editing the ``REGISTRY_SERVER``, ``REGISTRY_USER`` For sample function below, modify the ``spec.image`` field in ``function-sample.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-sample @@ -145,4 +145,4 @@ You can create this secret by editing the ``REGISTRY_SERVER``, ``REGISTRY_USER`` curl http://serving-q6wdp-ksvc-wk6mv.default..sslip.io/bar hello, bar! - ``` \ No newline at end of file + ``` diff --git a/functions/knative/path-parameters-function-go/README.md b/functions/knative/path-parameters-function-go/README.md index ce39714..ce69777 100644 --- a/functions/knative/path-parameters-function-go/README.md +++ b/functions/knative/path-parameters-function-go/README.md @@ -81,7 +81,7 @@ You can create this secret by editing the ``REGISTRY_SERVER``, ``REGISTRY_USER`` For sample function below, modify the ``spec.image`` field in ``function-sample.yaml`` to your own container registry address: ```yaml - apiVersion: core.openfunction.io/v1beta1 + apiVersion: core.openfunction.io/v1beta2 kind: Function metadata: name: function-sample @@ -170,4 +170,4 @@ You can create this secret by editing the ``REGISTRY_SERVER``, ``REGISTRY_USER`` curl http://serving-gsx8g-ksvc-6fv9l.default..sslip.io/hello/openfunction {"hello":"openfunction"}% - ``` \ No newline at end of file + ``` diff --git a/functions/knative/with-output-binding/README.md b/functions/knative/with-output-binding/README.md index 5c6164b..fc622c2 100644 --- a/functions/knative/with-output-binding/README.md +++ b/functions/knative/with-output-binding/README.md @@ -59,7 +59,7 @@ kubectl apply -f ../../async/bindings/kafka-input/kafka-input.yaml > The function plugin mechanism is also demonstrated in `function-front`, and you can observe the following configuration in the definition of `function-front`. > > ```yaml -> apiVersion: core.openfunction.io/v1beta1 +> apiVersion: core.openfunction.io/v1beta2 > kind: Function > metadata: > name: function-front