Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Examples for pod and image matches #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,19 @@ SEVERITY ID CHECK STATUS FAILED PASSED SKIPPED
Medium CUSTOM-001 Replicas limit Passed 0 2 0
```

The flag `--disable-builtin` disables the built-in Marvin checks.
The flag `--disable-builtin` disables the built-in Marvin checks.

If the check matches a PodSpec (`Pod`, `ReplicationController`, `ReplicaSet`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job` or `CronJob`)
the `podSpec` and `allContainers` inputs are available for expressions.
### Variables podSpec and allContainers

The `allContainers` input is a list of all containers including `initContainers` and `ephemeralContainers`.
The `podSpec` and `allContainers` inputs are available for expressions.

If the check matches a PodSpec (`Pod`, `ReplicationController`, `ReplicaSet`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job` or `CronJob`), with `podSpec` will check the correct key and value from Kubernetes objects above.

See this example with [podSpec](https://github.com/undistro/marvin/blob/0e81c81a7d30111df0b91010d57f100ede533cc1/internal/builtins/general/M-410_resource_using_invalid_restartpolicy.yaml#L32C37-L32C37, "podSpec").

The `allContainers` input is a list of all containers including `initContainers` and `ephemeralContainers`. With, `allContainers` will check all keys and values for containers presents on Kubernetes objects.

See this example with [allContainers](https://github.com/undistro/marvin/blob/0e81c81a7d30111df0b91010d57f100ede533cc1/internal/builtins/general/M-400_image_tag_latest.yaml#L44, "allContainers").

## Skipping resources

Expand Down