Skip to content

Commit 3b4bd68

Browse files
committed
Fix some typos
Signed-off-by: Jose Fuentes <[email protected]>
1 parent 1cc8491 commit 3b4bd68

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/how_to_write_packages.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
A Preflight package contains the definition of a policy. A policy is a set of rules that Preflight will check in your cluster.
66

7-
Preflight packages are made of two well distinguished parts, the _policy manifest_ and the _REGO_ definition of the rules.
7+
Preflight packages are made of two well distinguished parts, the _policy manifest_ and the _Rego_ definition of the rules.
88

99
<img align="center" width="460" height="300" src="./images/preflight_package.png">
1010

1111
## Writing the _policy manifest_
1212

13-
The _policy manifest_ is a _YAML_ file that contains information about your policy. You can see [here](https://godoc.org/github.com/jetstack/preflight/pkg/packaging#policy manifest) the schema of this file.
13+
The _policy manifest_ is a _YAML_ file that contains information about your policy. You can see [here](https://godoc.org/github.com/jetstack/preflight/pkg/packaging#PolicyManifest) the schema of this file.
1414

1515
There is some metadata for the package, such as the name and the description.
1616

@@ -84,17 +84,17 @@ sections:
8484
- "https://kubernetes.io/docs/concepts/containers/images/"
8585
```
8686

87-
## Writing the policy definition in REGO
87+
## Writing the policy definition in Rego
8888

8989
In the previous section, we created the _policy manifest_, which contains a human readable description of the rules in our policy. Now it's time to define the same rules in a language that is machine readable.
9090

91-
### The REGO package
91+
### The Rego package
9292

93-
Preflight relies on Open Policy Agent as the policy engine. REGO is OPA's language to define policies. You can find a comprenhensive [documentation](https://www.openpolicyagent.org/docs/latest/policy-language/).
93+
Preflight relies on Open Policy Agent as the policy engine. Rego is OPA's language to define policies. You can find a comprenhensive [documentation](https://www.openpolicyagent.org/docs/latest/policy-language/).
9494

95-
You can have multiple REGO files inside the directory of a Preflight package. All the REGO rules corresponding to the _policy manifest_ rules must be in the same REGO package, and that package must be indicated in the _policy manifest_ using the `root-query` property.
95+
You can have multiple Rego files inside the directory of a Preflight package. All the Rego rules corresponding to the _policy manifest_ rules must be in the same Rego package, and that package must be indicated in the _policy manifest_ using the `root-query` property.
9696

97-
For instance, this snippet shows an arbitrary REGO rule in a package named `podsbestpractices`:
97+
For instance, this snippet shows an arbitrary Rego rule in a package named `podsbestpractices`:
9898

9999
```
100100
package pods
@@ -106,16 +106,16 @@ preflight_tag_not_latest {
106106
}
107107
```
108108

109-
As you can identify, the REGO package for that policy is `pods`. In this case, OPA's `root-query` is `data.pods`, and that is why in the previous section, `policy-manifest.yaml` contains `root-query: "data.pods"`.
109+
As you can identify, the Rego package for that policy is `pods`. In this case, OPA's `root-query` is `data.pods`, and that is why in the previous section, `policy-manifest.yaml` contains `root-query: "data.pods"`.
110110

111-
### Writing REGO rules
111+
### Writing Rego rules
112112

113-
REGO can be challenging at the beginning because it does not behaves like a traditional programming language. It is strongly recommended to read ["The Basics"](https://www.openpolicyagent.org/docs/latest/policy-language/#the-basics). Also, it is useful to have the [language refence](https://www.openpolicyagent.org/docs/latest/policy-reference/) at hand.
113+
Rego can be challenging at the beginning because it does not behaves like a traditional programming language. It is strongly recommended to read ["The Basics"](https://www.openpolicyagent.org/docs/latest/policy-language/#the-basics). Also, it is useful to have the [language refence](https://www.openpolicyagent.org/docs/latest/policy-reference/) at hand.
114114

115-
You will get faster as you write more REGO rules. In order to speed up this process, it's best to write tests for your rules, even if you think they are not needed. It means you can iterate fast while writing rules and make sure the rules are doing what you intended. It is conventional to name the test files for `policy.rego` as `policy_test.rego`.
115+
You will get faster as you write more Rego rules. In order to speed up this process, it's best to write tests for your rules, even if you think they are not needed. It means you can iterate fast while writing rules and make sure the rules are doing what you intended. It is conventional to name the test files for `policy.rego` as `policy_test.rego`.
116116

117117

118-
This example contains the definition for the `tag_no_latest` rule. As you can see, there is the convention within Preflight to add `preflight_` as prefix to the rule ID when that is written in REGO (related issue #27).
118+
This example contains the definition for the `tag_no_latest` rule. As you can see, there is the convention within Preflight to add `preflight_` as prefix to the rule ID when that is written in Rego (related issue #27).
119119

120120
```
121121
# preflight-packages/examples.jetstack.io/podsbestpractices/policy.rego
@@ -155,11 +155,11 @@ containers_using_latest[container] {
155155
}
156156
```
157157

158-
### Testing REGO
158+
### Testing Rego
159159

160-
As mentioned before, it is very useful to [write tests for the REGO rules](https://www.openpolicyagent.org/docs/latest/policy-testing/).
160+
As mentioned before, it is very useful to [write tests for the Rego rules](https://www.openpolicyagent.org/docs/latest/policy-testing/).
161161

162-
This snippet contains a testsuite for the previous REGO code.
162+
This snippet contains a testsuite for the previous Rego code.
163163

164164
```
165165
# preflight-packages/examples.jetstack.io/podsbestpractices/policy_test.rego
@@ -220,7 +220,7 @@ test_tag_not_latest_latest_multiple {
220220
}
221221
```
222222

223-
Soon, Preflight will be able to run REGO tests inside Preflight packages (#26), but unfortunatelly this is not possible yet.
223+
Soon, Preflight will be able to run Rego tests inside Preflight packages (#26), but unfortunatelly this is not possible yet.
224224

225225
However it is possible to run these tests directly with the [OPA command line](https://www.openpolicyagent.org/docs/latest/#running-opa):
226226

0 commit comments

Comments
 (0)