Expand description
Annotation-based rule ignoring (pragma). Annotation-based rule ignoring for k8s-optimize.
Supports ignore-check.k8s-optimize.io/<check-code> annotations
to disable specific optimization checks for individual objects.
§Example
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
annotations:
# Ignore the high CPU request check for this deployment
ignore-check.k8s-optimize.io/K8S-OPT-005: "Batch processing requires high CPU"
# Ignore the excessive CPU ratio check
ignore-check.k8s-optimize.io/K8S-OPT-007: ""
spec:
# ...Constants§
- IGNORE_
ANNOTATION_ PREFIX - Prefix for k8s-optimize ignore annotations.
Functions§
- extract_
annotations - Extract annotations from a YAML value’s metadata.
- get_
ignore_ reason - Get the reason for ignoring a rule (if provided in the annotation value).
- get_
ignored_ rules - Extract the set of ignored rule codes from an object’s annotations.
- should_
ignore_ rule - Check if a specific rule should be ignored for an object.