cockroachdb / cockroachdb/cockroach

cli: allow user to be passed into to `debug zip` command

Open
#111,120 2 comments 0 reactions 0 assignees View on GitHub
A-cli-admin C-enhancement
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

### Addendum

The RPC on the server-side requires that the certificate used to connect is either for `root` or `node`. So the CLI change should not be made unless that changes. See: https://github.com/cockroachdb/cockroach/blob/0a4cbd702e9188f39243319477091e3b5545700d/pkg/rpc/auth.go#L315-L332

In order for this to be done, something like [#51454](https://github.com/cockroachdb/cockroach/issues/51454) should be completed first. That issue involves re-implementing every endpoint used by debug zip in a different way, which is either a cross team project, or something that would be under the Server team.

----

`cockroach debug zip` only works for the root user right now. If you try to use a different user, it shows an error like:
```
> ./cockroach debug zip --url 'postgresql://tester@localhost:36257/defaultdb?sslcert=certs%2Fclient.tester.crt&sslkey=certs%2Fclient.tester.key&sslmode=verify-full&sslrootcert=certs%2Fca.crt' d.zip

warning: --url specifies user/password, but command "zip" does not accept user/password details - details ignored

ERROR: invalid argument "postgresql://tester@localhost:36257/defaultdb?sslcert=certs%2Fclient.tester.crt&sslkey=certs%2Fclient.tester.key&sslmode=verify-full&sslrootcert=certs%2Fca.crt" for "--url" flag: invalid file name for "sslcert": expected "client.root.crt", got "client.tester.crt"
```

The command should not ignore the provided user. It should also allow the `--user` flag to work.

Jira issue: CRDB-31775

Epic CC-25593

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.