Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Last active December 7, 2025 23:01
Show Gist options
  • Select an option

  • Save larkintuckerllc/3096f0dbae47ef6c55b35e1135aa9672 to your computer and use it in GitHub Desktop.

Select an option

Save larkintuckerllc/3096f0dbae47ef6c55b35e1135aa9672 to your computer and use it in GitHub Desktop.
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: pod-without-team-label
spec:
steps:
- try:
- apply:
file: resources.yaml
- assert:
resource:
apiVersion: v1
kind: Pod
metadata:
name: test
(labels != null): true
- assert:
resource:
apiVersion: v1
kind: Pod
metadata:
name: test
(length(keys(labels)) == `2`): true
(labels.environment == 'prod'): true
(labels.team == 'bravo'): true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment