Skip to content

feat: extend engine to support live ConfigMap validation (#10) - #69

Open
vedant-kawale-27 wants to merge 1 commit into
hudazaan:mainfrom
vedant-kawale-27:feature/configmap-validation
Open

feat: extend engine to support live ConfigMap validation (#10)#69
vedant-kawale-27 wants to merge 1 commit into
hudazaan:mainfrom
vedant-kawale-27:feature/configmap-validation

Conversation

@vedant-kawale-27

Copy link
Copy Markdown
Contributor

### Description

This PR extends the recursive discovery engine to support live ConfigMap validation, mirroring the existing Kubernetes Secret reference validation.

Specifically, it:

  1. Adds recursive spec parsing to extract ConfigMap references via valueFrom.configMapKeyRef.name and envFrom[*].configMapRef.name in Pod templates.
  2. Integrates namespaced ConfigMap existence and key-presence verification via read_namespaced_config_map.
  3. Adds a new Type column to the terminal output table to clearly differentiate between SECRET and CONFIGMAP validation rows.
  4. Updates GitHub actions formatters and SARIF rule generators (missing-configmap, missing-configmap-key).
  5. Adds unit/integration test coverage and a test manifest for local verification.

Closes #10


Pull Request Checklist

  • I have kept changes focused and limited to the stated issue
  • I did not commit secrets or .env values
  • All tests pass locally via poetry run pytest
  • The change was tested with a real sample manifest
  • My commits are signed off using git commit -s
  • Any new CLI behavior or output change is documented in this PR

Copilot AI review requested due to automatic review settings July 2, 2026 18:39
@vedant-kawale-27
vedant-kawale-27 force-pushed the feature/configmap-validation branch from 73a8764 to 680784d Compare July 2, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Kuberef’s recursive reference discovery and live cluster validation to include Kubernetes ConfigMap references (in addition to the existing Secret validation), and updates CLI + CI/SARIF outputs to differentiate resource types.

Changes:

  • Added recursive extraction of ConfigMap references from Pod specs (configMapKeyRef and configMapRef patterns).
  • Added live ConfigMap existence + key validation via read_namespaced_config_map, and introduced a Type column in the Rich output table.
  • Updated GitHub annotations/SARIF generation for new ConfigMap-related rules, and added unit/integration tests plus a local test manifest.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/kuberef/main.py Adds ConfigMap reference extraction and integrates ConfigMap validation into the audit loop; updates CLI table columns.
src/kuberef/formatters.py Adds GitHub annotation + SARIF messaging/rules for missing ConfigMaps and missing ConfigMap keys.
tests/test_parser.py Adds unit test for ConfigMap reference extraction and an integration-style CLI test with mocked K8s API.
test-manifests/configmap-test.yaml Adds a local manual verification manifest covering pass/warn/fail ConfigMap cases.
mock-k8s/mock_k8s_server.py Introduces a simple mock Kubernetes API server for local/manual testing of secrets/configmaps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/kuberef/main.py Outdated
Comment thread src/kuberef/main.py Outdated
Comment thread src/kuberef/formatters.py Outdated
Comment thread src/kuberef/formatters.py Outdated
Comment thread mock-k8s/mock_k8s_server.py
Comment thread mock-k8s/mock_k8s_server.py
Comment thread src/kuberef/formatters.py Outdated
Comment thread src/kuberef/formatters.py Outdated
Comment thread mock-k8s/mock_k8s_server.py
@vedant-kawale-27
vedant-kawale-27 force-pushed the feature/configmap-validation branch 2 times, most recently from 36994f5 to 922eb34 Compare July 2, 2026 18:53
Signed-off-by: vedant-kawale-27 <vedantkawale0304@gmail.com>
@vedant-kawale-27
vedant-kawale-27 force-pushed the feature/configmap-validation branch from 922eb34 to fb000f9 Compare July 2, 2026 18:58
@vedant-kawale-27

Copy link
Copy Markdown
Contributor Author

hee @hudazaan please merge it
today is the last date to merge pr
if any changes please tell asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ConfigMap Validation

2 participants