From 99bac62f0618e0b0ab0549ad14eb7f72c8d69414 Mon Sep 17 00:00:00 2001 From: Pete Muir Date: Wed, 28 Nov 2018 17:02:28 -0500 Subject: [PATCH] feat: enable plugin validation --- pkg/extensions/plugins.go | 1 + pkg/jx/cmd/get_plugins.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/pkg/extensions/plugins.go b/pkg/extensions/plugins.go index f799651e75..a56d4a98c9 100644 --- a/pkg/extensions/plugins.go +++ b/pkg/extensions/plugins.go @@ -217,6 +217,7 @@ func EnsurePluginInstalled(plugin jenkinsv1.Plugin) (string, error) { return path, nil } +// TODO needs a test func ValidatePlugins(jxClient jenkinsv1client.Interface, ns string) error { // Validate installed plugins plugins, err := jxClient.JenkinsV1().Plugins(ns).List(metav1.ListOptions{}) diff --git a/pkg/jx/cmd/get_plugins.go b/pkg/jx/cmd/get_plugins.go index df4d5ab55e..274cb1fba8 100644 --- a/pkg/jx/cmd/get_plugins.go +++ b/pkg/jx/cmd/get_plugins.go @@ -133,5 +133,16 @@ func (o *GetPluginsOptions) PrintExtensionPlugins() error { // Add a trailing line to make the output more readable log.Infoln("") } + + jxClient, ns, err := o.JXClientAndDevNamespace() + if err != nil { + return err + } + + err = extensions.ValidatePlugins(jxClient, ns) + if err != nil { + return err + } + return nil }