Skip to content

feat: report audit config scan status#1515

Open
MaxRink wants to merge 2 commits into
mondoohq:mainfrom
MaxRink:feat/auditconfig-scan-status
Open

feat: report audit config scan status#1515
MaxRink wants to merge 2 commits into
mondoohq:mainfrom
MaxRink:feat/auditconfig-scan-status

Conversation

@MaxRink

@MaxRink MaxRink commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a typed status.scans surface to MondooAuditConfig for Kubernetes resource, external Kubernetes resource, container image, and node scans.
  • Derive scan phase, target, backing CronJob, active Jobs, and last schedule/success timestamps from managed scan workloads.
  • Cover status transitions for pending, running, succeeded, failed, and disabled scans in focused helper/controller tests.

Tests

  • go test ./pkg/utils/mondoo ./controllers/k8s_scan ./controllers/container_image ./controllers/nodes
  • git diff --check
  • go test ./... (fails only in tests/integration: requires MONDOO_ORG_MRN and Kubernetes configuration / KUBERNETES_MASTER)

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mondoo-code-review mondoo-code-review Bot 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.

New scan status reporting in MondooAuditConfig status works correctly with good test coverage.

Comment thread pkg/utils/mondoo/scan_status.go
Comment thread controllers/k8s_scan/deployment_handler.go
Comment thread controllers/nodes/deployment_handler.go
@MaxRink

MaxRink commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I have read the Mondoo CLA Document and I hereby sign the CLA

mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 15, 2026

@mondoo-code-review mondoo-code-review Bot 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.

Scan status reporting now correctly distinguishes running-with-prior-failure from pure running, and avoids redundant API calls for external cluster status updates.

@MaxRink

MaxRink commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/review

@MaxRink

MaxRink commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 4f3eab5. ± Comparison against base commit 70733ca.

♻️ This comment has been updated with latest results.

mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 17, 2026

@mondoo-code-review mondoo-code-review Bot 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.

Helm CRD files synced to match operator CRD definitions — no functional issues.

mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 17, 2026

@mondoo-code-review mondoo-code-review Bot 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.

CI spell-check action downgraded from v0.0.26 to v0.0.25 to use a non-advisory version; no functional code changes.

@mondoo-code-review mondoo-code-review Bot 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.

New scan status reporting in MondooAuditConfig status works correctly across all scan types.

Comment thread .github/workflows/spell-check.yaml Outdated
mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 17, 2026

@mondoo-code-review mondoo-code-review Bot 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.

Removes the unsafe spell-check comment job, addressing the previous version downgrade concern by eliminating the job entirely.

mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 17, 2026

@mondoo-code-review mondoo-code-review Bot 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.

CI config updates: restores spell-check to v0.0.26 and adds 403 to accepted link-check status codes.

@mondoo-code-review mondoo-code-review Bot 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.

New scan status reporting in MondooAuditConfig status works correctly across all scan types.

Comment thread pkg/utils/mondoo/scan_status.go
mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 17, 2026

@mondoo-code-review mondoo-code-review Bot 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.

Spell-check workflow updated to acknowledge a security advisory for check-spelling v0.0.26.

mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 19, 2026

@mondoo-code-review mondoo-code-review Bot 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.

New scan status reporting in MondooAuditConfig status works correctly across all three scan controllers.

mondoo-code-review[bot]
mondoo-code-review Bot previously approved these changes Jun 19, 2026

@mondoo-code-review mondoo-code-review Bot 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.

Correctly handles initial DaemonSet state by reporting Pending instead of Running when no nodes are scheduled yet.

@mondoo-code-review mondoo-code-review Bot 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.

Removes unused 403 status code from link-check config, no functional impact on the operator.

@MaxRink MaxRink marked this pull request as draft June 19, 2026 06:13
@MaxRink MaxRink marked this pull request as ready for review June 19, 2026 08:15
@MaxRink MaxRink force-pushed the feat/auditconfig-scan-status branch from b147f1a to 4f3eab5 Compare June 19, 2026 08:39
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.

1 participant