Minor docs and test cleanup related to the SSH configuration
All checks were successful
ci/woodpecker/tag/release Pipeline was successful

This commit is contained in:
2026-06-01 09:51:14 -05:00
parent 7eed1a26ae
commit 529172c754
5 changed files with 8 additions and 13 deletions

View File

@@ -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")
}