Commit 95eac83
committed
fix(helm-e2e): rewrite kubeconfig server when running inside a container
When helm-k3s-local.sh runs inside a Docker container that mounts the
host's docker socket (e.g., a GitHub Actions `container:` job), k3d
creates the cluster on the host's daemon and publishes the API server
on `0.0.0.0:<port>` of the host. From inside the CI container that
address is unreachable, so kubectl (and helm OpenAPI validation) fail
with 'dial tcp 0.0.0.0:<port>: connect: connection refused'.
After merging the kubeconfig, detect that we're in a container via
/.dockerenv and rewrite the server URL to the default-route gateway
(which routes to the docker host on standard sibling-container setups).
The API cert isn't signed for the gateway IP, so also mark the cluster
insecure-skip-tls-verify and clear the embedded CA — CI-only path; the
local-dev case where 0.0.0.0 already works is unchanged.1 parent d663a7f commit 95eac83
1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
117 | 145 | | |
118 | 146 | | |
119 | 147 | | |
| |||
0 commit comments