Repository navigation
Commit 3aef989
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.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>1 parent 5c6ce86 commit 3aef989
2 files changed
Lines changed: 497 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