ManageIQ / manageiq-providers-kubevirt

ManageIQ plugin for the Kubevirt provider.
https://kubevirt.io/
Apache License 2.0
4 stars 29 forks source link

Fix KubeVirt endpoint verification #195

Closed agrare closed 2 years ago

agrare commented 2 years ago

connection.valid? doesn't return the same connection which causes a later check for #virt_supported? to return nil when the connection actually does support virtualization.

The result was even with valid endpoint info and credentials the credential verification would always fail with "unknown error"

(byebug) kubevirt
#<ManageIQ::Providers::Kubevirt::InfraManager::Connection:0x0000559626830880 @namespace="default", ...
(byebug) kubevirt.valid?
#<Kubeclient::Resource kind="Namespace", apiVersion="v1", ...
(byebug) kubevirt.valid?.virt_supported? # This is essentially what https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/457/files#diff-1fe0d067134e4f6092c7cf36d13501a6d283dcc890e7279c0de4059af6a49de5L817 was doing
nil
Fryguy commented 2 years ago

Backported to morphy in commit 2b3f08a5782e22cf3edb6ed9044d9a441b8a12aa.

commit 2b3f08a5782e22cf3edb6ed9044d9a441b8a12aa
Author: Keenan Brock <keenan@thebrocks.net>
Date:   Mon Jan 31 12:43:43 2022 -0500

    Merge pull request #195 from agrare/fix_kubevirt_endpoint_verification

    Fix KubeVirt endpoint verification

    (cherry picked from commit 664c55ab22e0104a9407d9d51476cf8c302a34a2)