Commit 597d519
feat: add MondooOperatorConfig for proxy and image registry support (#1391)
* feat: add MondooOperatorConfig for proxy and image registry support
Introduce MondooOperatorConfig CRD with support for:
- HTTP/HTTPS proxy configuration (httpProxy, httpsProxy, noProxy)
- Container proxy for image scanning
- Image pull secrets for private registries
- Image registry mirror support
- Registry mirrors mapping
- Skip proxy for cnspec option
Tested on GKE Autopilot successfully.
* refactor: improve MondooOperatorConfig quality and documentation
- Address code quality issues and extract clone() helper
- Make noProxy matching case-insensitive
- Add logging for imagePullSecret lookup failures
- Default createConfig to true in Helm values
- Remove deprecated marker from imageRegistry field
- Add tests for KeychainFromSecrets and applyImageRegistry
- Add operator config documentation
* fix: address review issues in MondooOperatorConfig integration
- Fix imagePullSecrets to append instead of clobber existing secrets
- Prefer HTTPS proxy for --api-proxy (Mondoo API is always HTTPS)
- Add APIProxyURL helper to centralize proxy URL selection
- Watch MondooOperatorConfig changes to trigger reconciliation
- Share image cache across keychain changes (use pointer mutex)
- Remove scaffolding comments from types
- Fix "MondooOpertorConfig" typos in log messages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add proxy and registry integration tests for resource builders
Add comprehensive test coverage for MondooOperatorConfig proxy and
registry mirror integration across all resource builders:
- pkg/utils/k8s: ProxyEnvVars and APIProxyURL unit tests
- k8s_scan: proxy, skip-proxy, imagePullSecrets, container-proxy tests
- container_image: proxy, skip-proxy, imagePullSecrets, container-proxy tests
- nodes: CronJob and DaemonSet proxy/skip-proxy/imagePullSecrets tests
- resource_watcher: HTTPS preference, skip-proxy, env vars, imagePullSecrets tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: increase CronJob schedule buffer in integration tests
The cron schedule only uses the minute field, so the effective buffer
between function call time and the CronJob trigger is
(targetMinuteStart - now), which could be as low as 16 seconds with
the old 75-second offset. This wasn't enough when leader election
takes ~46 seconds, causing the CronJob to miss its scheduled minute
and wait an hour for the next trigger.
Increase the offset from 1m15s to 2m30s, guaranteeing at least ~91
seconds of buffer regardless of when in the current minute the
function is called.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: include CRDs in helm template test output
The CRDs live in charts/mondoo-operator/crds/ (not templates/),
so helm template doesn't render them by default. Add --include-crds
to the Template helper so TestHelmTemplate can verify CRDs are present.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: correct CronJob schedule buffer and increase retry window
The 2m30s buffer was too aggressive - worst-case trigger time (~150s)
exceeded the retry window (100s), causing tests to time out before
CronJobs fired. Reduce buffer to 2m (61-120s range) and double
RetryLoop from 50 to 100 (200s window) to accommodate the buffer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: improve integration test reliability and cleanup
- Add CronJobRetryLoop (600s) for WaitUntilCronJobsSuccessful to handle
variable scan durations without affecting other retry timeouts
- Clean up stale k3d target cluster before creating in external cluster tests
- Add --ignore-not-found to pod deletion in AfterTest cleanup
- Downgrade completed CronJob pod describe failure from ERROR to WARN
- Regenerate CRD and RBAC manifests for updated type docs and job delete verb
- Fix whitespace alignment in container_image_resolver_test.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add expected words for spell checker
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: jpaodev <jpaodev@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent af62f04 commit 597d519
File tree
47 files changed
+4318
-1483
lines changed- .github/actions/spelling
- api/v1alpha2
- charts/mondoo-operator
- crds
- templates
- cmd/mondoo-operator/operator
- config
- crd/bases
- rbac
- samples
- controllers
- container_image
- integration
- k8s_scan
- nodes
- resource_watcher
- status
- docs
- hack
- pkg
- client
- common
- mondooclient
- imagecache
- utils
- k8s
- mondoo
- fake
- tests
- framework/utils
- integration
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
47 files changed
+4318
-1483
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 19 | | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
30 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
33 | 54 | | |
34 | 55 | | |
35 | 56 | | |
| |||
41 | 62 | | |
42 | 63 | | |
43 | 64 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 65 | | |
48 | 66 | | |
49 | 67 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments