Skip to content

Commit 68afb9d

Browse files
committed
fix(redis): fix lint errors and regenerate golden files
1 parent 384c8b6 commit 68afb9d

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Connect to a Redis cluster using locally installed redis-cli. The command will check if redis-cli is installed, download the certificate if TLS is enabled, and prompt for the password.
4+
5+
USAGE:
6+
scw redis cluster connect <cluster-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Connect to a Redis cluster
10+
scw redis cluster connect
11+
12+
Connect to a Redis cluster via private network
13+
scw redis cluster connect
14+
15+
ARGS:
16+
[private-network=false] Connect by the private network endpoint attached.
17+
cluster-id UUID of the cluster
18+
[cli-redis] Command line tool to use, default to redis-cli
19+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2)
20+
21+
FLAGS:
22+
-h, --help help for connect
23+
24+
GLOBAL FLAGS:
25+
-c, --config string The path to the config file
26+
-D, --debug Enable debug mode
27+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
28+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-redis-cluster-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USAGE:
66
scw redis cluster <command>
77

88
AVAILABLE COMMANDS:
9+
connect Connect to a Redis cluster using locally installed redis-cli
910
create Create a Redis™ Database Instance
1011
delete Delete a Redis™ Database Instance
1112
get Get a Redis™ Database Instance

internal/namespaces/redis/v1/custom_cluster.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func clusterConnectCommand() *core.Command {
442442
}
443443

444444
if len(endpoint.IPs) == 0 {
445-
return nil, fmt.Errorf("endpoint has no IP addresses")
445+
return nil, errors.New("endpoint has no IP addresses")
446446
}
447447

448448
port := endpoint.Port
@@ -464,7 +464,7 @@ func clusterConnectCommand() *core.Command {
464464

465465
tmpDir := os.TempDir()
466466
certPath = filepath.Join(tmpDir, fmt.Sprintf("redis-cert-%s.crt", args.ClusterID))
467-
if err := os.WriteFile(certPath, certContent, 0600); err != nil {
467+
if err := os.WriteFile(certPath, certContent, 0o600); err != nil {
468468
return nil, fmt.Errorf("failed to write certificate: %w", err)
469469
}
470470
defer func() {
@@ -508,6 +508,7 @@ func clusterConnectCommand() *core.Command {
508508
if exitError, ok := err.(*exec.ExitError); ok {
509509
return nil, &core.CliError{Empty: true, Code: exitError.ExitCode()}
510510
}
511+
511512
return nil, err
512513
}
513514

0 commit comments

Comments
 (0)