Skip to content

Commit 8590831

Browse files
authored
Merge pull request #460 from trogowski/fix-docs-typos
docs: fix a couple of minor docs typos/mistakes
2 parents 54561a2 + 51103c0 commit 8590831

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

docs/reference/lang/codelab/collaborative.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ In order to complete the collaborative configuration development, we first need
8383
│ └── main.k
8484
├── kcl.mod
8585
└── pkg
86-
└── sever.k
86+
└── server.k
8787
```
8888

8989
The directory of the project mainly contains three parts:
@@ -280,7 +280,7 @@ server:
280280
env: dev
281281
```
282282

283-
Using the same method, we can build the production configuration, write the code in the `dev/main.k` file, and add a label to it.
283+
Using the same method, we can build the production configuration, write the code in the `prod/main.k` file, and add a label to it.
284284

285285
```python
286286
import pkg

docs/reference/lang/codelab/schema.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ nginx = Nginx {
526526
```python
527527
nginx = NginxProd {
528528
labels.run = "my-nginx"
529-
labels.env = "pre-prod"
529+
labels.env = "prod"
530530
}
531531
```
532532

@@ -575,10 +575,10 @@ Now, we can complete the declaration of the server configuration through the Dep
575575
576576
However, usually, the actual situation is more complicated, and the deployment may have a variety of optional variable accessories.
577577
578-
For example, we want to support a persistent volume claim based on an existing schema, as a reusable Kubernetes schema. In this case, we can just wrapper it with a `mixin` and a `protocol` as follows:
578+
For example, we want to support a persistent volume claim based on an existing schema, as a reusable Kubernetes schema. In this case, we can just wrap it with a `mixin` and a `protocol` as follows:
579579

580580
```python
581-
import k8spkg.api.core.v1
581+
import k8s.api.core.v1
582582
583583
protocol PVCProtocol:
584584
pvc?: {str:}
@@ -604,6 +604,12 @@ mixin PersistentVolumeClaimMixin for PVCProtocol:
604604
}
605605
```
606606
607+
> Note: for the `k8s.api.core.v1` import to work, we need to initialize a module and add the `k8s` module as a dependency:
608+
> ```bash
609+
> kcl mod init
610+
> kcl mod add k8s
611+
> ```
612+
607613
With this PersistentVolumeClaimMixin, we define a PVC schema with a clear `user interface`, and use Kubernetes PVC as an implementation. Then, we can define a server schema with Deployment schema, and PVC mixin schema.
608614

609615
```

docs/reference/lang/codelab/simple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ _priorityCpuMap = {
450450
"3" = 1024
451451
}
452452
# Using a dict to simplify logic and the default value is 2048
453-
_cpu = _priorityCpuMap[_priority] or 2048
453+
_cpu = _priorityCpuMap[str(_priority)] or 2048
454454
_name = "nginx"
455455
# exported variables
456456
cpu = _cpu

0 commit comments

Comments
 (0)