Skip to content

Commit 4ce3c33

Browse files
authored
Merge pull request openshift#7276 from mburke5678/online-3.9-stage
[online-3.9] added metadata:name to templates
2 parents 29cbfdc + 8645a98 commit 4ce3c33

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

dev_guide/templates.adoc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ Here is an example of a full template with parameter definitions and references:
503503
----
504504
kind: Template
505505
apiVersion: v1
506+
metadata:
507+
name: my-template
506508
objects:
507509
- kind: BuildConfig
508510
apiVersion: v1
@@ -579,6 +581,8 @@ earlier.
579581
----
580582
kind: "Template"
581583
apiVersion: "v1"
584+
metadata:
585+
name: my-template
582586
objects:
583587
- kind: "Service" <1>
584588
apiVersion: "v1"
@@ -661,34 +665,39 @@ Unless escaped with a backslash, Kubernetes' JSONPath implementation interprets
661665
characters such as `.`, `@`, and others as metacharacters, regardless of their
662666
position in the expression. Therefore, for example, to refer to a `ConfigMap`
663667
datum named `my.key`, the required JSONPath expression would be
664-
`{.data['my\.key']}`.
668+
`{.data['my\.key']}`. Depending on how the JSONPath expression is then written in YAML,
669+
an additional backslash might be required, for example `"{.data['my\\.key']}"`.
665670
====
666671

667672
The following is an example of different objects' fields being exposed:
668673

669-
====
670674
[source,yaml]
671675
----
672676
kind: Template
673677
apiVersion: v1
678+
metadata:
679+
name: my-template
674680
objects:
675681
- kind: ConfigMap
676682
apiVersion: v1
677683
metadata:
684+
name: my-template-config
678685
annotations:
679-
template.openshift.io/expose-username: "{.data['my\.username']}"
686+
template.openshift.io/expose-username: "{.data['my\\.username']}"
680687
data:
681688
my.username: foo
682689
- kind: Secret
683690
apiVersion: v1
684691
metadata:
692+
name: my-template-config-secret
685693
annotations:
686694
template.openshift.io/base64-expose-password: "{.data['password']}"
687695
stringData:
688696
password: bar
689697
- kind: Service
690698
apiVersion: v1
691699
metadata:
700+
name: my-template-service
692701
annotations:
693702
template.openshift.io/expose-service_ip_port: "{.spec.clusterIP}:{.spec.ports[?(.name==\"web\")].port}"
694703
spec:
@@ -698,11 +707,12 @@ objects:
698707
- kind: Route
699708
apiVersion: v1
700709
metadata:
710+
name: my-template-route
701711
annotations:
702712
template.openshift.io/expose-uri: "http://{.spec.host}{.spec.path}"
703713
spec:
704714
path: mypath
705-
====
715+
----
706716

707717
An example response to a `bind` operation given the above partial template
708718
follows:
@@ -802,6 +812,8 @@ annotation. Further examples can be found in the OpenShift quickstart templates.
802812
----
803813
kind: Template
804814
apiVersion: v1
815+
metadata:
816+
name: my-template
805817
objects:
806818
- kind: BuildConfig
807819
apiVersion: v1

0 commit comments

Comments
 (0)