doc/tutorial/kubernetes: tutorial fixes
Some of the cue expressions in the tutorial had
redundant disjunctions; fix them to use appropriate defaults.
Also use `bool` in one case where it's appropriate,
and use `*true | bool` instead of `*true | false` throughout,
as being a slightly better (more general) pattern to follow.
Change-Id: I9107e3b32efe694e92cf9720ac529f9166ea7755
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3340
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/doc/tutorial/kubernetes/README.md b/doc/tutorial/kubernetes/README.md
index d9d7a6c..80ca7b0 100644
--- a/doc/tutorial/kubernetes/README.md
+++ b/doc/tutorial/kubernetes/README.md
@@ -1109,7 +1109,7 @@
package cloud
service <Name>: {
- name: Name | string // the name of the service
+ name: *Name | string // the name of the service
...
@@ -1120,7 +1120,7 @@
}
deployment <Name>: {
- name: Name | string
+ name: *Name | string
...
}
```
@@ -1150,7 +1150,7 @@
```
deployment <Name>: _base & {
- name: Name | string
+ name: *Name | string
...
```
@@ -1202,10 +1202,10 @@
```
volume <Name>: {
- name: Name | string
+ name: *Name | string
mountPath: string
subPath: null | string
- readOnly: false | true
+ readOnly: bool
kubernetes: {}
}
```
@@ -1228,8 +1228,8 @@
// Copy over all ports exposed from containers.
port "\(Name)": {
- port: Port | int
- targetPort: Port | int
+ port: *Port | int
+ targetPort: *Port | int
} for Name, Port in spec.expose.port
// Copy over the labels