doc/tutorial/kubernetes: update to use new syntax consistently
set version in parser/interface.go to 2000 to enforce.
Change-Id: I15dadb94bbce630bc5f37653cf51439386cfdee8
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/4206
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/doc/tutorial/kubernetes/README.md b/doc/tutorial/kubernetes/README.md
index bdd25b1..b949be2 100644
--- a/doc/tutorial/kubernetes/README.md
+++ b/doc/tutorial/kubernetes/README.md
@@ -109,7 +109,7 @@
tree at the path with the "kind" as first element and "name" as second.
```
-$ cue import ./... -p kube -l '"\(strings.ToCamel(kind))" "\(metadata.name)"' -f
+$ cue import ./... -p kube -l '"\(strings.ToCamel(kind))": "\(metadata.name)"' -f
```
The added `-l` flag defines the labels for each object, based on values from
@@ -162,8 +162,10 @@
The `-R` option attempts to detect structured YAML or JSON strings embedded
in the configuration files and then converts these recursively.
+<-- TODO: update import label format -->
+
```
-$ cue import ./... -p kube -l '"\(strings.ToCamel(kind))" "\(metadata.name)"' -f -R
+$ cue import ./... -p kube -l '"\(strings.ToCamel(kind))": "\(metadata.name)"' -f -R
```
Now the file looks like:
@@ -273,18 +275,18 @@
deployment: [ID=_]: {
apiVersion: "apps/v1"
kind: "Deployment"
- metadata name: ID
+ metadata: name: ID
spec: {
// 1 is the default, but we allow any number
replicas: *1 | int
template: {
- metadata labels: {
+ metadata: labels: {
app: ID
domain: "prod"
component: string
}
// we always have one namesake container
- spec containers: [{ name: ID }]
+ spec: containers: [{ name: ID }]
}
}
}
@@ -440,7 +442,7 @@
apiVersion: "apps/v1"
kind: "Deployment"
Name :: ID
- spec replicas: *1 | int
+ spec: replicas: *1 | int
}
configMap: [ID=_]: {
diff --git a/doc/tutorial/kubernetes/tut_test.go b/doc/tutorial/kubernetes/tut_test.go
index 601e1c3..b123be8 100644
--- a/doc/tutorial/kubernetes/tut_test.go
+++ b/doc/tutorial/kubernetes/tut_test.go
@@ -167,7 +167,8 @@
}
cuetest.Run(t, wd, cmd, &cuetest.Config{
- Stdin: strings.NewReader(input),
+ Stdin: strings.NewReader(input),
+ Stdout: os.Stdout,
})
case strings.HasPrefix(cmd, "sed "):