Repository navigation
Commit 0d4b629
committed
Add unit tests for GetMCRegistryConf and IsDisconnectedOCP
Add comprehensive unit tests for the disconnected environment detection
and registry configuration retrieval functions in the util package.
Tests cover:
- IsNoMatchError: Detects both 'no matches for kind' (real API server) and
'no kind is registered' (fake client) errors
- IsDisconnectedOCP: Tests with ICSP, IDMS, both, empty lists, and
missing CRDs (graceful degradation)
- GetMCRegistryConf: Tests successful retrieval, missing MachineConfig,
missing CRD, invalid ignition format, missing base64 prefix, and
invalid base64 content
- Full scenario tests for disconnected environments and non-OpenShift
cluster graceful degradation
The IsNoMatchError function is updated to also detect 'no kind is registered'
errors which occur in functional tests where the fake client behaves
differently than a real Kubernetes API server.
The MachineConfigNotFound test verifies that IsNotFound errors are NOT
treated as IsNoMatchError - when the CRD exists but the resource doesn't,
this should be an error (not a warning), indicating misconfiguration.1 parent 4bd324a commit 0d4b629
2 files changed
Lines changed: 505 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
0 commit comments