Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

typo "come" --> "some" #70

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/pages/using-policies/basics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Policies are very powerful and can block/deny `kubectl` requests for example, so


## `JsPolicy` YAML files
If someone shares a standalone `JsPolicy` object as a YAML file with you (or you created the file yourself), then you will likely find the `spec.javascript` field showing come JavaScript code embedded inside the YAML. Optionally, there may also be the `spec.dependencies` field filled with a list of `npm` packages that are used within this policy.
If someone shares a standalone `JsPolicy` object as a YAML file with you (or you created the file yourself), then you will likely find the `spec.javascript` field showing some JavaScript code embedded inside the YAML. Optionally, there may also be the `spec.dependencies` field filled with a list of `npm` packages that are used within this policy.

To apply such a policy in your cluster, simply create the `JsPolicy` object in your cluster:
```bash
Expand Down Expand Up @@ -84,4 +84,4 @@ To instantiate this policy, just apply it to your cluster:
```bash
kubectl apply -f policy.yaml
```
As with any `JsPolicy` object that provides the `spec.javascript` field, jsPolicy will generate a corresponding `JsPolicyBundle`. This bundle will also contain the code for the `disallowNamespaces` function since this function is imported in our policy code and will be directly embedded so that jsPolicy does not need to download any packages later on when executing this policy. This makes the execution of policies extremly fast even if they are using external packages.
As with any `JsPolicy` object that provides the `spec.javascript` field, jsPolicy will generate a corresponding `JsPolicyBundle`. This bundle will also contain the code for the `disallowNamespaces` function since this function is imported in our policy code and will be directly embedded so that jsPolicy does not need to download any packages later on when executing this policy. This makes the execution of policies extremly fast even if they are using external packages.