mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-24 12:17:01 +00:00
Merge pull request #71 from schuhu/httpproxy
FIX: enable http_proxy environment variable
This commit is contained in:
commit
0bf6b97269
3 changed files with 15 additions and 0 deletions
|
|
@ -231,6 +231,13 @@ bandwidth costs might be applicable. Since bandwidth from Github Packages within
|
||||||
Github Container Registry to also be usable for free within Github Actions in the future. If that were not to be the
|
Github Container Registry to also be usable for free within Github Actions in the future. If that were not to be the
|
||||||
case, I might publish the Docker image to a different platform.
|
case, I might publish the Docker image to a different platform.
|
||||||
|
|
||||||
|
### Proxy support
|
||||||
|
|
||||||
|
Kubeconform will respect the HTTPS_PROXY variable when downloading schema files.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ HTTPS_PROXY=proxy.local bin/kubeconform fixtures/valid.yaml
|
||||||
|
```
|
||||||
### Speed comparison with Kubeval
|
### Speed comparison with Kubeval
|
||||||
|
|
||||||
Running on a pretty large kubeconfigs setup, on a laptop with 4 cores:
|
Running on a pretty large kubeconfigs setup, on a laptop with 4 cores:
|
||||||
|
|
|
||||||
|
|
@ -281,3 +281,10 @@ resetCacheFolder() {
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "$output" = 'Summary: 2 resources found in 1 file - Valid: 2, Invalid: 0, Errors: 0, Skipped: 0' ]
|
[ "$output" = 'Summary: 2 resources found in 1 file - Valid: 2, Invalid: 0, Errors: 0, Skipped: 0' ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "Should support HTTPS_PROXY" {
|
||||||
|
# This only tests that the HTTPS_PROXY variable is picked up and that it tries to use it
|
||||||
|
run bash -c "HTTPS_PROXY=127.0.0.1:1234 bin/kubeconform fixtures/valid.yaml"
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
[[ "$output" == *"proxyconnect tcp: dial tcp 127.0.0.1:1234: connect: connection refused"* ]]
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ func newHTTPRegistry(schemaPathTemplate string, cacheFolder string, strict bool,
|
||||||
MaxIdleConns: 100,
|
MaxIdleConns: 100,
|
||||||
IdleConnTimeout: 3 * time.Second,
|
IdleConnTimeout: 3 * time.Second,
|
||||||
DisableCompression: true,
|
DisableCompression: true,
|
||||||
|
Proxy: http.ProxyFromEnvironment,
|
||||||
}
|
}
|
||||||
|
|
||||||
if skipTLS {
|
if skipTLS {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue