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
fix: kind installer/Resource not present #3994
Conversation
67e96a8
to
fddd98c
Compare
Fixes containers#2794 Signed-off-by: Jeff MAURY <jmaury@redhat.com>
fddd98c
to
2da9d72
Compare
cc @dgolovin you invested transparent proxy , there was a missing |
Just want to say that i'm setting my env to test this PR. i didn't forget about it and sorry for the super late response. |
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'll keep trying but it looks to me that something does not work as expected.
What i've done:
I set up fiddler so i could use it as a proxy.
I set the proxy to 127.0.0.1:8888 in podman desktop but i receive a http error fetch failed when it tries to fetch kind releases on https://api.github.com/repos/kubernetes-sigs/kind/releases.
If i try the same on postman or on a browser i get the response fine.
Can you see the request going through Fiddler ? |
|
Any idea why it's being rejected ? |
it seems it's a problem with the certificate. |
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.
So i guess it's not an actual problem. Just me that i used an internal signed certificate.
LGTM, GJ!! 🚀
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.
it looks I never sent my review (I have a pending review item), so clicking on submit review even if it's too late
|
||
private overrideFetch() { | ||
const original = globalThis.fetch; | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
const _me = this; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
globalThis.fetch = function (url: RequestInfo | URL, opts?: any) { | ||
const proxyurl = getProxyUrl(_me); | ||
if (proxyurl) { | ||
opts = Object.assign({}, opts, { dispatcher: new ProxyAgent(proxyurl) }); | ||
} | ||
|
||
return original(url, opts); | ||
}; | ||
} |
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'm wondering if it should not go the https://github.com/containers/podman-desktop/blob/main/packages/main/src/plugin/extension-loader.ts#L217-L218
Also I'm wondering about the need of undici
library
it looks like that for createHttpPatchedModules
https://www.npmjs.com/package/hpagent is used so it looks like to be a duplicated dependency
Probably some code could be shared with createHttpPatchedModules from proxy-resolver.ts class
Fixes #2794
What does this PR do?
Ensure libraries using NodeJS fetch implementation are proxy compatible. That would include the kind and compose extensions.
WARNING This part makes the assumption that the proxy configuration is either httpProxy if the proxy is using HTTP with the browser/Podman Desktop or httpsProxy if using HTTPS (ie configuring both makes no sense). Also this PR does not implement support for NO_PROXY, should be a follow up PR
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
Fixes #2794
How to test this PR?