run-as-non-root: flag explicit root group#1178
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1178 +/- ##
===========================================
- Coverage 62.36% 31.16% -31.20%
===========================================
Files 197 239 +42
Lines 4854 6545 +1691
===========================================
- Hits 3027 2040 -987
- Misses 1439 4328 +2889
+ Partials 388 177 -211
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
62c37fc to
46f9011
Compare
|
@rhybrillou pls check |
61f1c66 to
c0a40c7
Compare
|
I see this as ready on the branch side and currently only maintainer/CI follow-up appears to be blocking. Please re-run checks / re-review and let me know if any additional adjustments are needed. |
|
I confirmed this branch is still clean on code/tests and patch coverage passes; only Please rerun maintainer-side CI/codecov check for final validation after confirming no additional code changes are needed. |
|
FYI branch is code-complete and tests pass; only is failing while all other checks are success (including ). Current blocker appears to be coverage project baseline/CI semantics, not code regressions. Please re-run coverage from maintainer side and re-review. |
|
Branch is code-complete and tests pass. |
c0a40c7 to
b5e78d7
Compare
Summary
Extend the
run-as-non-roottemplate so it also reports containers that explicitly resolve torunAsGroup: 0.The check now resolves
runAsGroupfrom container and pod security contexts using the same precedence as Kubernetes: container-level settings override pod-level settings. It only reports an explicit root group value, so workloads that omitrunAsGroupkeep the existing behavior.Fixes #748.
Validation
gofmt -w pkg/templates/runasnonroot/template.go pkg/templates/runasnonroot/template_test.goGOCACHE=/private/tmp/kube-linter-gocache GOMODCACHE=/private/tmp/kube-linter-gomodcache go test ./pkg/templates/runasnonrootGOCACHE=/private/tmp/kube-linter-gocache GOMODCACHE=/private/tmp/kube-linter-gomodcache go test ./pkg/templates/...GOCACHE=/private/tmp/kube-linter-gocache GOMODCACHE=/private/tmp/kube-linter-gomodcache go test ./pkg/builtinchecks/...GOCACHE=/private/tmp/kube-linter-gocache GOMODCACHE=/private/tmp/kube-linter-gomodcache go run ./cmd/kube-linter templates list --format markdown | diff - docs/generated/templates.mdGOCACHE=/private/tmp/kube-linter-gocache GOMODCACHE=/private/tmp/kube-linter-gomodcache go run ./cmd/kube-linter checks list --format markdown | diff - docs/generated/checks.mdgit diff --check