-
Notifications
You must be signed in to change notification settings - Fork 504
fix(cli): match Go's functions serve docker-down error, kong reload args, and secrets filtering #5976
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
base: develop
Are you sure you want to change the base?
fix(cli): match Go's functions serve docker-down error, kong reload args, and secrets filtering #5976
Changes from all commits
bfdda3a
817e60b
fa051de
a025a02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,34 @@ export const LEGACY_SUGGEST_DOCKER_INSTALL = | |
| * subprocess-stderr equivalent of Go's `client.IsErrConnectionFailed` (which | ||
| * inspects the Docker API client error). The docker / podman CLIs print | ||
| * "Cannot connect to the Docker daemon …" / "Cannot connect to Podman …" (often | ||
| * followed by "Is the docker daemon running?") when the socket is down. | ||
| * followed by "Is the docker daemon running?") when the socket is down, and | ||
| * "permission denied while trying to connect to the Docker daemon socket …" | ||
| * when the socket exists but the user can't open it — the pinned Docker SDK | ||
| * classifies that permission error as a connection failure too | ||
| * (`client/request.go:144-152`, docker/docker v28.5.2: `os.IsPermission` → | ||
| * `errConnectionFailed`), so Go surfaces the install hint for it as well. | ||
| * | ||
| * Also matches `spawnContainerCli`'s runtime-not-found message | ||
| * ("docker: command not found …", `legacy-container-cli.ts`): a missing | ||
| * container-CLI binary is the shell-out equivalent of Go's missing daemon | ||
| * socket — on a machine with no Docker installed, Go's socket dial fails, | ||
| * `client.IsErrConnectionFailed` fires, and the install hint is exactly the | ||
| * guidance that case needs (`misc.go:155-166`). | ||
| * | ||
| * "error during connect" is the pinned SDK's uniform outer wrap for every | ||
| * transport-level failure (`client/request.go:175-185`, docker/docker | ||
| * v28.5.2) and therefore the closest 1:1 stderr equivalent of | ||
| * `errConnectionFailed`'s breadth. It notably covers Windows daemon-down, | ||
| * where a failed npipe open is wrapped as "error during connect: this error | ||
| * may indicate that the docker daemon is not running: …" (elevated, | ||
| * `request.go:181`) or "… the docker client must be run with elevated | ||
| * privileges …" (non-elevated, `request.go:178`) — word orders none of the | ||
| * Unix-socket phrases match. The inner OS text ("The system cannot find the | ||
| * file specified") is localized per the SDK's own comment | ||
| * (`request.go:172-174`), so it is deliberately not matched. | ||
| */ | ||
| export function legacyIsDockerDaemonUnreachable(stderr: string): boolean { | ||
| return /cannot connect to the docker daemon|cannot connect to podman|is the docker daemon running/iu.test( | ||
| return /cannot connect to the docker daemon|cannot connect to podman|is the docker daemon running|permission denied while trying to connect|docker: command not found|error during connect/iu.test( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fragile coupling: |
||
| stderr, | ||
| ); | ||
| } | ||
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.
Stale doc comment: this says "keys verbatim", but the final behavior (restored in 817e60b) is that
toPlainEdgeRuntimeConfiguppercases secret names —name.toUpperCase()inshared/functions/serve.ts, matching Go'sstrings.ToUpperviper workaround (pkg/config/config.go:766-771). This line was written for the earlier verbatim-keys revision of this PR and no longer describes what the referenced helper does. Should read something like "keys UPPERCASED (Go'sstrings.ToUpperconfig-load workaround), empty and unresolved-env()values filtered out (Go'sSHA256 > 0gate)".