Skip to content

Commit 0f5a632

Browse files
authored
elasticsearch: Fix broken diagnostics command (#110)
Fixes the broken diagnostics command by using `os.Create` rather than `os.Open` for the .zip bundled file. Additionally adds a notee about a potentially necessary timeout increase in order to complete the operation. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 4945fbb commit 0f5a632

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/deployment/elasticsearch/diagnose.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ import (
3333
var generateElasticsearchDiagnosticsCmd = &cobra.Command{
3434
Use: "diagnose <cluster id>",
3535
Short: "Generates a diagnostics bundle for the cluster",
36+
Long: "Generates a diagnostics bundle for the cluster, a timeout increase might be necessary",
3637
PreRunE: cmdutil.MinimumNArgsAndUUID(1),
3738
RunE: func(cmd *cobra.Command, args []string) error {
3839
location := cmd.Flag("location").Value.String()
3940
filename := fmt.Sprint("diagnostic-", args[0], ".zip")
4041
path := filepath.Join(location, filename)
4142

42-
f, err := os.Open(path)
43+
f, err := os.Create(path)
4344
if err != nil {
4445
return err
4546
}

docs/ecctl_deployment_elasticsearch_diagnose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Generates a diagnostics bundle for the cluster
44

55
### Synopsis
66

7-
Generates a diagnostics bundle for the cluster
7+
Generates a diagnostics bundle for the cluster, a timeout increase might be necessary
88

99
```
1010
ecctl deployment elasticsearch diagnose <cluster id> [flags]

0 commit comments

Comments
 (0)