Skip to content

Commit

Permalink
Merge pull request #74 from Peefy/psp-check-supplemental-groups-modules
Browse files Browse the repository at this point in the history
feat: add psp-check-supplemental-groups-modules
  • Loading branch information
Peefy authored Nov 13, 2023
2 parents 6e48ce8 + abff52f commit 0c1128a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions psp-check-supplemental-groups/README.md
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)
5 changes: 5 additions & 0 deletions psp-check-supplemental-groups/kcl.mod
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.
8 changes: 8 additions & 0 deletions psp-check-supplemental-groups/main.k
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 []]

0 comments on commit 0c1128a

Please sign in to comment.