From 529172c7545712f299c07bd7aa7da762b4871720 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 1 Jun 2026 09:51:14 -0500 Subject: [PATCH] Minor docs and test cleanup related to the SSH configuration --- docs/config.md | 2 +- docs/troubleshooting.md | 4 ++-- internal/config/config.go | 2 -- internal/config/load_test.go | 4 ++-- internal/config/validate.go | 9 +++------ 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/config.md b/docs/config.md index 50b2a59..76df4a1 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1,4 +1,4 @@ -# Distributor Configuration +# Configuration Reference ## Config File Location diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index f90edb8..abaee44 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -150,7 +150,7 @@ Safe fix: remove one source of the credential or make the deployment intentional ## `host is required for ssh backend` -Likely cause: SSH config is missing the structured `host` field, or an old URI-based SSH config is still in use. +Likely cause: SSH config is missing the structured `host` field, or an old URL-style SSH config is still in use. Diagnostic: @@ -158,7 +158,7 @@ Diagnostic: go run ./cmd/distributor run --config --dry-run ``` -Safe fix: configure SSH with `host`, optional `user` and `port`, and `path`. The `uri` field is not used for SSH execution. +Safe fix: configure SSH with `host`, optional `user` and `port`, and `path`. SSH URLs are not part of the active config schema. ## `no SSH auth methods configured` diff --git a/internal/config/config.go b/internal/config/config.go index f1439a3..4e9fa7c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -23,7 +23,6 @@ type Destination struct { User string `yaml:"user"` Port int `yaml:"port"` Path string `yaml:"path"` - URI string `yaml:"uri"` Endpoint string `yaml:"endpoint"` Bucket string `yaml:"bucket"` Prefix string `yaml:"prefix"` @@ -42,7 +41,6 @@ type Backend struct { User string `yaml:"user"` Port int `yaml:"port"` Path string `yaml:"path"` - URI string `yaml:"uri"` Endpoint string `yaml:"endpoint"` Bucket string `yaml:"bucket"` Prefix string `yaml:"prefix"` diff --git a/internal/config/load_test.go b/internal/config/load_test.go index 7f5111e..4091fa6 100644 --- a/internal/config/load_test.go +++ b/internal/config/load_test.go @@ -349,7 +349,7 @@ pipelines: } } -func TestLoadFileRejectsSSHURIExecutionConfig(t *testing.T) { +func TestLoadFileRejectsLegacySSHURIFieldAsUnknown(t *testing.T) { assertLoadError(t, ` pipelines: - id: reports @@ -361,7 +361,7 @@ pipelines: - id: archive backend: local path: /archive -`, "uri is not supported for ssh backend") +`, "field uri not found") } func TestLoadFileRejectsUnsupportedBackend(t *testing.T) { diff --git a/internal/config/validate.go b/internal/config/validate.go index fd74547..4abf7d5 100644 --- a/internal/config/validate.go +++ b/internal/config/validate.go @@ -69,14 +69,14 @@ func Validate(cfg Config) error { } func validateSourceBackend(errs ValidationErrors, context string, backend Backend) ValidationErrors { - return validateBackend(errs, context, backend.Backend, backend.Host, backend.Port, backend.Path, backend.URI, backend.Endpoint, backend.Bucket, backend.Prefix, backend.SSH.HostKeyPolicy, backend.Creds) + return validateBackend(errs, context, backend.Backend, backend.Host, backend.Port, backend.Path, backend.Endpoint, backend.Bucket, backend.Prefix, backend.SSH.HostKeyPolicy, backend.Creds) } func validateDestinationBackend(errs ValidationErrors, context string, destination Destination) ValidationErrors { - return validateBackend(errs, context, destination.Backend, destination.Host, destination.Port, destination.Path, destination.URI, destination.Endpoint, destination.Bucket, destination.Prefix, destination.SSH.HostKeyPolicy, destination.Creds) + return validateBackend(errs, context, destination.Backend, destination.Host, destination.Port, destination.Path, destination.Endpoint, destination.Bucket, destination.Prefix, destination.SSH.HostKeyPolicy, destination.Creds) } -func validateBackend(errs ValidationErrors, context, backend, host string, port int, path, uri, endpoint, bucket, prefix string, hostKeyPolicy HostKeyPolicy, creds Credentials) ValidationErrors { +func validateBackend(errs ValidationErrors, context, backend, host string, port int, path, endpoint, bucket, prefix string, hostKeyPolicy HostKeyPolicy, creds Credentials) ValidationErrors { switch backend { case "": errs = append(errs, context+".backend is required") @@ -91,9 +91,6 @@ func validateBackend(errs ValidationErrors, context, backend, host string, port if path == "" { errs = append(errs, context+".path is required for ssh backend") } - if uri != "" { - errs = append(errs, context+".uri is not supported for ssh backend; use host, user, port, and path") - } if port < 0 || port > 65535 { errs = append(errs, context+".port must be between 1 and 65535") }