added detail json for addons

pull/15866/head
Swastik_Gour 2023-02-16 07:41:50 +05:30
parent 8d12bf3d19
commit cd787da24e
1 changed files with 10 additions and 4 deletions

View File

@ -166,13 +166,19 @@ var printAddonsJSON = func(cc *config.ClusterConfig) {
addonBundle := assets.Addons[addonName]
enabled := addonBundle.IsEnabled(cc)
maintainer := addonBundle.Maintainer
docs := addonBundle.Docs
addonsMap[addonName] = map[string]interface{}{
"Status": stringFromStatus(enabled),
"Profile": cc.Name,
"maintainer": maintainer,
"docs": docs,
}
}
jsonString, _ := json.Marshal(addonsMap)
out.String(string(jsonString))
jsonOut, err := json.MarshalIndent(addonsMap, "", " ")
if err != nil {
exit.Error(reason.InternalJSONMarshal, "Failed to marshal addons to JSON", err)
}
fmt.Println(string(jsonOut))
}