mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
Several improvements Improve wording Co-authored-by: Ashleigh Brennan <abrennan@redhat.com> Improve wording Co-authored-by: Ashleigh Brennan <abrennan@redhat.com> Improve wording Include an annotation example
36 lines
823 B
Plaintext
36 lines
823 B
Plaintext
[id="serverless-functions-adding-annotations_{context}"]
|
|
= Adding annotations to 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.
|