You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(kubevirt): Add enforcement and validation for runStrategy over deprecated running field
Strengthen the VM creation guidance and add explicit test assertions to ensure
the deprecated 'running' field is not used in VirtualMachine specs.
Changes to VM Creation Template (plan.tmpl):
- Add prominent warning section about deprecated 'running' field
- Include side-by-side comparison showing incorrect vs. correct usage
- Clear visual indicators (❌ INCORRECT vs. ✅ CORRECT)
- Emphasize that 'runStrategy' must be used instead
Changes to Test Helper Functions (verify-vm.sh):
- Add new `verify_no_deprecated_running_field()` function
- Explicitly checks that spec.running is not set
- Returns failure if deprecated field is found
- Provides clear error message directing users to use runStrategy
Changes to Test Tasks (all 5 VM creation tests):
- Add assertion in all test tasks to verify running field is not used
- Tests now explicitly call `verify_no_deprecated_running_field()`
- Ensures compliance with KubeVirt best practices
- Tests fail if VMs are created with deprecated field
Benefits:
- Prevents use of deprecated KubeVirt API fields
- Explicit test coverage for API field deprecation
- Clear guidance for AI assistants creating VMs
- Ensures forward compatibility with future KubeVirt versions
- Enforces best practices through automated testing
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
**Note:** The `running` field is deprecated in KubeVirt. VirtualMachines should use `runStrategy` instead. This function ensures compliance with current best practices.
74
+
75
+
---
76
+
62
77
### verify_instancetype
63
78
Verifies that a VM has an instancetype reference with optional exact match.
0 commit comments