-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kubevirt_cdi_upload module #52990
Conversation
e54f677
to
4d94ee0
Compare
FYI: can't use |
@mmazur I am not sure what do you want to drop and why. Please provide more details. |
The test
|
@mmazur I'm also interested in being able to use a user CA with ansible tools like get_url and uri. Do you know if there's an existing feature request? |
@jamescassell A long time ago someone tried this, but then gave up. Old PR: #32049 |
@pkliczewski that was a note to any ansible core dev that will need to merge this, which is required because this module uses the external python |
4d94ee0
to
a10c3e0
Compare
shipit |
# Let's check the file's there before we do anything else | ||
imgfile = open(path, 'rb') | ||
|
||
resource = self.find_resource(KIND, api_version, fail=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using find_supported_resource
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sh… I forgot.
@@ -161,6 +161,7 @@ lib/ansible/modules/cloud/google/gcpubsub_facts.py E322 | |||
lib/ansible/modules/cloud/google/gcpubsub_facts.py E324 | |||
lib/ansible/modules/cloud/google/gcpubsub_facts.py E326 | |||
lib/ansible/modules/cloud/google/gcspanner.py E322 | |||
lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py E203 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we can't fix this issue? AFAIK shouldn't be complex to fix,no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd need to take this and rewrite it: #32049, then get it merged, then modify this patch to use it. The first time this issue came came up (when merging k8s_auth
) I figured that'd be my plan B, as that's quite a time investment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and openshift
which we depend on uses requests
(or was it urllib3
?) anyways under the hood, so it's not like there's anything gained from the user's POV.
description: | ||
- URL containing the host and port on which the CDI Upload Proxy is available. | ||
- "More info: U(https://github.com/kubevirt/containerized-data-importer/blob/master/doc/upload.md#expose-cdi-uploadproxy-service)" | ||
upload_host_verify_ssl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this different than the equivalent option specified in k8s_auth_options? Does this module connect to two API endpoints, and you could have two different cert-validation settings? Can we re-use the one defined in k8s_auth_options here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is completely different. Stuff in k8s_auth_options controls connectivity to the kubernetes cluster's api server endpoint. This module does that, but then also connects to a service running on the cluster itself (called the Containerized Data Importer Upload Proxy), which is why it has a completely separate set of upload_host_*
parameters that control that.
It's probable that before The Freeze I'll be attempting to switch the default on upload_host_verify_ssl
to autodetect (aka "look for a Secret with the certs in a standard place") for ease of use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that clarification. Upon reviewing the code, it wasn't obvious to me that this module is actively using both connection paths (to the k8s API and also to the Upload Proxy.) I've taken your word for it and updated my related PR.
SUMMARY
Adds a module for uploading VM images from local system to kubernetes PVC's using the Containerized Data Importer
ISSUE TYPE
COMPONENT NAME
kubevirt_cdi_upload