From 6360413905746dc22ec556e6e610faed8115a847 Mon Sep 17 00:00:00 2001 From: Lucas Teixeira Date: Tue, 26 Dec 2023 10:24:31 -0300 Subject: [PATCH 1/2] created session for variables podSpec and allImage Signed-off-by: Lucas Teixeira --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ecb8308..c5fa41a 100644 --- a/README.md +++ b/README.md @@ -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 From d9328f79d3c1d326305718ef65ec4c04dcc85452 Mon Sep 17 00:00:00 2001 From: Lucas Teixeira Date: Tue, 26 Dec 2023 10:31:25 -0300 Subject: [PATCH 2/2] created a subsession for variables podSpec and allImage Signed-off-by: Lucas Teixeira --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5fa41a..eeb01ed 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Medium CUSTOM-001 Replicas limit Passed 0 2 0 The flag `--disable-builtin` disables the built-in Marvin checks. -## Variables podSpec and allContainers +### Variables podSpec and allContainers The `podSpec` and `allContainers` inputs are available for expressions.