Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
pull/31403/head
Suleiman Dibirov 3 months ago
parent 2b787a1efd
commit 6ea425b732

@ -146,7 +146,7 @@ func (i *HTTPInstaller) Update() error {
return fmt.Errorf("method Update() not implemented for HttpInstaller")
}
// GetLatestVersion fetches the latest version of the plugin.Add a comment on lines R158 to R160Add diff commentMarkdown input: edit mode selected.WritePreviewAdd a suggestionHeadingBoldItalicQuoteCodeLinkUnordered listNumbered listTask listMentionReferenceSaved repliesAdd FilesPaste, drop, or click to add filesCancelCommentStart a reviewReturn to code
// GetLatestVersion fetches the latest version of the plugin.
func (i *HTTPInstaller) GetLatestVersion() (string, error) {
return "", fmt.Errorf("not supported")
}

@ -58,7 +58,11 @@ func newPluginListCmd(out io.Writer) *cobra.Command {
signingInfo := plugin.GetSigningInfoForPlugins(plugins)
table := uitable.New()
table.AddRow("NAME", "VERSION", "LATEST", "TYPE", "APIVERSION", "PROVENANCE", "SOURCE")
if o.showOutdated {
table.AddRow("NAME", "VERSION", "LATEST", "TYPE", "APIVERSION", "PROVENANCE", "SOURCE")
} else {
table.AddRow("NAME", "VERSION", "TYPE", "APIVERSION", "PROVENANCE", "SOURCE")
}
for _, p := range plugins {
m := p.Metadata()
sourceURL := m.SourceURL
@ -71,13 +75,16 @@ func newPluginListCmd(out io.Writer) *cobra.Command {
signedStatus = info.Status
}
latest, err := getLatestVersion(p)
if err != nil {
latest = "unknown"
}
if o.showOutdated {
latest, err := getLatestVersion(p)
if err != nil {
slog.Debug("getLatestVersion", err.Error())
latest = "unknown"
}
if !o.showOutdated || (latest != "unknown" && latest != m.Version) {
table.AddRow(m.Name, m.Version, latest, m.Type, m.APIVersion, signedStatus, sourceURL)
} else {
table.AddRow(m.Name, m.Version, m.Type, m.APIVersion, signedStatus, sourceURL)
}
}
fmt.Fprintln(out, table)

Loading…
Cancel
Save