1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/serverless-functions-adding-annotations.adoc
2022-02-17 20:44:52 +00:00

49 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * serverless/functions/serverless-functions-annotations.adoc
:_content-type: PROCEDURE
[id="serverless-functions-adding-annotations_{context}"]
= Adding annotations to a function
You can use the following procedure to add annotations to a function.
.Prerequisites
* The {ServerlessOperatorName} and Knative Serving are installed on the cluster.
* You have installed the `kn` CLI.
* You have created a function.
.Procedure
. Open the `func.yaml` file for your function.
. For every annotation that you want to add, add the following YAML to the `annotations` section:
+
[source,yaml]
----
name: test
namespace: ""
runtime: go
...
annotations:
<annotation_name>: "<annotation_value>" <1>
----
<1> Substitute `<annotation_name>: "<annotation_value>"` with your annotation.
+
For example, to indicate that a function was authored by Alice, you might include the following annotation:
+
[source,yaml]
----
name: test
namespace: ""
runtime: go
...
annotations:
author: "alice@example.com"
----
. Save the configuration.
The next time you deploy your function to the cluster, the annotations are added to the corresponding Knative service.