mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
fix crash
This commit is contained in:
@@ -285,9 +285,11 @@ func IlmExplain(conf *cfg.Config, index string) error {
|
||||
|
||||
info := ""
|
||||
|
||||
err = json.Unmarshal(ilm.StepInfo["reason"], &info)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to unmarshal step info: %w", err)
|
||||
if len(ilm.StepInfo["reason"]) > 0 {
|
||||
err = json.Unmarshal(ilm.StepInfo["reason"], &info)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to unmarshal step info: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
table.Entries = [][]any{
|
||||
@@ -299,8 +301,11 @@ func IlmExplain(conf *cfg.Config, index string) error {
|
||||
{"phase", *ilm.Phase},
|
||||
{"phase execution", ilmPhaseString(ilm.PhaseExecution.PhaseDefinition, false)},
|
||||
{"step", *ilm.Step},
|
||||
{"failed step", *ilm.FailedStep},
|
||||
{"failed step retry count", ilm.FailedStepRetryCount},
|
||||
}
|
||||
|
||||
if ilm.FailedStep != nil {
|
||||
table.AddRow("failed step", *ilm.FailedStep)
|
||||
table.AddRow("failed step retry count", ilm.FailedStepRetryCount)
|
||||
}
|
||||
|
||||
if err := table.Print(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user