feat: Add privileged_client support to VirtualMachineInstance#2648
Draft
feat: Add privileged_client support to VirtualMachineInstance#2648
Conversation
Introduce explicit privileged_client parameter across VirtualMachineInstance methods to support proper RBAC-aware client usage. New public methods replacing deprecated properties: - get_virt_launcher_pod, get_virt_handler_pod, get_node, get_xml_dict Modified methods with privileged_client parameter: - pause, unpause, reset, get_xml, execute_virsh_command - get_dommemstat, get_domstate, wait_until_running, api_request New private helpers: - _get_pod_user_uid, _is_pod_root - _get_hypervisor_connection_uri, _build_virsh_cmd - _resolve_privileged_client, _get_subresource_api_url Warning strategy: - FutureWarning when privileged_client is omitted - DeprecationWarning on old property-based access
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add explicit
privileged_clientparameter support acrossVirtualMachineInstancemethods to enable proper RBAC-aware client usage, replacing implicit reliance onself.clientfor privileged operations.New public methods (replacing deprecated properties)
get_virt_launcher_pod(privileged_client=...)— replacesvirt_launcher_podget_virt_handler_pod(privileged_client=...)— replacesvirt_handler_podget_node(privileged_client=...)— replacesnodeget_xml_dict(privileged_client=...)— replacesxml_dictModified methods with
privileged_clientparameterpause,unpause,resetget_xml,execute_virsh_commandget_dommemstat,get_domstatewait_until_runningapi_requestNew private helpers
_get_pod_user_uid— extract runAsUser UID from pod security context_is_pod_root— check if pod runs as root_get_hypervisor_connection_uri— build hypervisor socket URI_build_virsh_cmd— construct virsh command list_resolve_privileged_client— resolve client with FutureWarning fallback_get_subresource_api_url— build subresource API URL with optional clientDeprecation strategy
privileged_clientis omitted (falls back toself.client)virt_launcher_pod,virt_handler_pod,node,xml_dict, etc.)Consumer PR