-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add psp-check-supplemental-groups-modules
Signed-off-by: peefy <[email protected]>
- Loading branch information
Showing
4 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Introduction | ||
|
||
`psp-check-supplemental-groups` is a KCL PSP validation package. | ||
|
||
## Resource | ||
|
||
The Code source and document are [here](https://github.com/kcl-lang/modules/tree/main/psp-check-supplemental-groups) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
name = "psp-check-supplemental-groups" | ||
version = "0.1.0" | ||
description = "`psp-check-supplemental-groups` is a kcl validation package" | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Define the validation function | ||
validate = lambda item: {str:} { | ||
if item.kind == "Pod": | ||
assert item.spec?.securityContext?.supplementalGroups in ["100-200", "500-600"] | ||
item | ||
} | ||
# Validate All resource | ||
items = [validate(i) for i in option("items") or []] |