Files
Sankofa/docs/proxmox/WARNINGS_AND_FIXES.md
defiQUG 33d50fb91e
Some checks failed
API CI / API Lint (push) Successful in 47s
API CI / API Type Check (push) Failing after 47s
API CI / API Test (push) Successful in 1m0s
API CI / API Build (push) Failing after 50s
API CI / Build Docker Image (push) Has been skipped
Build Crossplane Provider / build (push) Failing after 5m51s
CD Pipeline / Deploy to Staging (push) Failing after 29s
CI Pipeline / Lint and Type Check (push) Failing after 36s
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Test Backend (push) Failing after 1m33s
CI Pipeline / Test Frontend (push) Failing after 30s
CI Pipeline / Security Scan (push) Failing after 1m16s
Crossplane Provider CI / Go Test (push) Failing after 3m23s
Crossplane Provider CI / Go Lint (push) Failing after 7m27s
Crossplane Provider CI / Go Build (push) Failing after 3m27s
Deploy to Staging / Deploy to Staging (push) Failing after 30s
Portal CI / Portal Lint (push) Failing after 21s
Portal CI / Portal Type Check (push) Failing after 21s
Portal CI / Portal Test (push) Failing after 21s
Portal CI / Portal Build (push) Failing after 22s
Test Suite / frontend-tests (push) Failing after 30s
Test Suite / api-tests (push) Failing after 49s
Test Suite / blockchain-tests (push) Failing after 30s
Type Check / type-check (map[directory:. name:root]) (push) Failing after 23s
Type Check / type-check (map[directory:api name:api]) (push) Failing after 21s
Type Check / type-check (map[directory:portal name:portal]) (push) Failing after 19s
Validate Configuration Files / validate (push) Failing after 1m52s
CD Pipeline / Deploy to Production (push) Has been skipped
chore: consolidate local WIP (repo cleanup 20260707)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:41:34 -07:00

199 lines
5.4 KiB
Markdown

# Provider Warnings and Recommended Fixes
**Date**: 2025-12-13
**Status**: ⚠️ **WARNINGS IDENTIFIED - FIXES RECOMMENDED**
---
## Issue Summary
The provider is logging repeated errors about missing CRDs. While these don't prevent basic VM operations, they create log noise and indicate incomplete configuration.
---
## Identified Issues
### ⚠️ Issue 1: Missing CRDs for Optional Controllers
**Error Messages** (repeating every 10 seconds):
```
ERROR controller-runtime.source.EventHandler if kind is a CRD, it should be installed before calling Start
{"kind": "ProxmoxVMScaleSet.proxmox.sankofa.nexus", "error": "no matches for kind \"ProxmoxVMScaleSet\" in version \"proxmox.sankofa.nexus/v1alpha1\""}
ERROR controller-runtime.source.EventHandler if kind is a CRD, it should be installed before calling Start
{"kind": "ResourceDiscovery.proxmox.sankofa.nexus", "error": "no matches for kind \"ResourceDiscovery\" in version \"proxmox.sankofa.nexus/v1alpha1\""}
```
**Root Cause**:
- The provider code (`cmd/provider/main.go`) unconditionally registers controllers for:
- `ProxmoxVMScaleSet` - For VM scaling operations
- `ResourceDiscovery` - For resource discovery operations
- These CRDs are not installed in the cluster
- Controller-runtime tries to watch these resources and fails repeatedly
**Impact**:
- ⚠️ **Log Noise**: Errors logged every 10 seconds
- ⚠️ **Resource Waste**: Continuous retry attempts
-**Functionality**: Basic VM operations still work (ProxmoxVM CRD is installed)
**Current Status**:
- `ProxmoxVM` CRD: ✅ Installed
- `ProviderConfig` CRD: ✅ Installed
- `ProxmoxVMScaleSet` CRD: ❌ Missing
- `ResourceDiscovery` CRD: ❌ Missing
---
## Recommended Fixes
### Option 1: Generate and Install Missing CRDs (Recommended if features are needed)
If you plan to use VM scaling or resource discovery features:
1. **Generate CRDs**:
```bash
cd crossplane-provider-proxmox
make manifests # or controller-gen crd paths=./apis/... output:crd:artifacts:config=config/crd/bases
```
2. **Install CRDs**:
```bash
kubectl apply -f crossplane-provider-proxmox/config/crd/bases/
```
3. **Verify**:
```bash
kubectl get crd | grep proxmox
# Should show all 4 CRDs
```
### Option 2: Make Controller Registration Conditional (Recommended if features are not needed)
Modify `cmd/provider/main.go` to only register controllers if CRDs exist:
```go
// Check if CRD exists before registering controller
if crdExists("proxmoxvmscalesets.proxmox.sankofa.nexus") {
if err = (&vmscaleset.ProxmoxVMScaleSetReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ProxmoxVMScaleSet")
os.Exit(1)
}
}
```
**Note**: This requires code changes and rebuilding the provider.
### Option 3: Suppress Errors (Temporary workaround)
If these features are not needed, you can:
- Filter logs to ignore these specific errors
- Accept the log noise (doesn't affect functionality)
---
## Verification
### Check Current CRDs
```bash
kubectl get crd | grep proxmox
```
**Expected Output** (if all CRDs installed):
```
proxmoxvms.proxmox.sankofa.nexus
proxmoxvmscalesets.proxmox.sankofa.nexus
providerconfigs.proxmox.sankofa.nexus
resourcediscoveries.proxmox.sankofa.nexus
```
**Current Output**:
```
proxmoxvms.proxmox.sankofa.nexus
providerconfigs.proxmox.sankofa.nexus
```
### Check Provider Logs
```bash
kubectl logs -n crossplane-system -l app=crossplane-provider-proxmox --tail=50 | grep -i error
```
**After Fix**: Should show no CRD-related errors.
---
## Impact Assessment
### Current Impact
| Aspect | Impact | Severity |
|--------|--------|----------|
| VM Operations | ✅ Working | None |
| Log Noise | ⚠️ High | Low |
| Resource Usage | ⚠️ Minor | Low |
| Functionality | ✅ Full | None |
### After Fix
| Aspect | Impact | Severity |
|--------|--------|----------|
| VM Operations | ✅ Working | None |
| Log Noise | ✅ Clean | None |
| Resource Usage | ✅ Optimal | None |
| Functionality | ✅ Full | None |
---
## Recommended Action
### Immediate Action (Choose One)
1. **If you need scaling/discovery features**: Generate and install missing CRDs
2. **If you don't need these features**: Accept log noise or modify code to make controllers conditional
3. **For production**: Fix the code to make controller registration conditional
### Priority
- **For Development/Testing**: Low priority (can be ignored)
- **For Production**: Medium priority (should be fixed to reduce log noise)
---
## Additional Notes
### Why This Happens
The provider was designed with multiple controllers, but:
- Not all CRDs were generated/installed
- Controller registration is unconditional
- Controller-runtime requires CRDs to exist before watching
### Best Practice
For production deployments:
- Only register controllers for installed CRDs
- Use feature flags or conditional registration
- Generate all CRDs during build process
---
## Conclusion
**Status**: ⚠️ **Warnings present but non-critical**
- Basic VM operations work correctly
- Log noise can be reduced by installing missing CRDs or modifying code
- No functional impact on current deployment
**Recommendation**: Fix before production deployment to reduce log noise and ensure clean operation.
---
**Last Updated**: 2025-12-13
**Status**: ⚠️ **WARNINGS IDENTIFIED - FIXES AVAILABLE**