Skip to content

Commit

Permalink
doc/tutorial/kubernetes
Browse files Browse the repository at this point in the history
Update Kubernetes tutorial.

Fixes cue-lang#31.

Change-Id: Ie6515dcdb61cc0aab59f20097f8e68317bc07d28
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/1842
Reviewed-by: Marcel van Lohuizen <mpvl@google.com>
  • Loading branch information
mpvl committed Apr 18, 2019
1 parent 433ab7a commit db4e4d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions doc/tutorial/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ Before we start the restructuring, lets save a full evaluation so that we
can verify that simplifications yield the same results.

```
$ cue eval ./... > snapshot
$ cue eval -c ./... > snapshot
```

The `-c` option tells `cue` that only concrete values, that is valid JSON,
are allowed.
We focus on the objects defined in the various `kube.cue` files.
A quick inspection reveals that many of the Deployments and Services share
common structure.
Expand Down Expand Up @@ -272,7 +274,7 @@ deployment <Name>: {
metadata name: Name
spec: {
// 1 is the default, but we allow any number
replicas: 1 | int
replicas: *1 | int
template: {
metadata labels: {
app: Name
Expand Down Expand Up @@ -322,7 +324,7 @@ other a user of the template will want to specify.
Let's compare the result of merging our new template to our original snapshot.

```
$ cue eval ./... > snapshot2
$ cue eval ./... -c > snapshot2
--- ./mon/alertmanager
non-concrete value (string)*:
./kube.cue:11:15
Expand Down Expand Up @@ -369,7 +371,7 @@ $ cue fmt kube.cue */kube.cue
Let's try again to see if it is fixed:

```
$ cue eval ./... > snapshot2
$ cue eval -c ./... > snapshot2
$ diff snapshot snapshot2
...
```
Expand Down

0 comments on commit db4e4d2

Please sign in to comment.