diff --git a/cmd/cache/list.go b/cmd/cache/list.go index b163532f04..493515f543 100644 --- a/cmd/cache/list.go +++ b/cmd/cache/list.go @@ -42,7 +42,7 @@ var listCmd = &cobra.Command{ color.Red("Error: %v", err) os.Exit(1) } - + for _, name := range names { println(name) } diff --git a/cmd/integration/activate.go b/cmd/integration/activate.go index aa799fc2a2..ffa1d47877 100644 --- a/cmd/integration/activate.go +++ b/cmd/integration/activate.go @@ -21,6 +21,10 @@ import ( "github.com/spf13/viper" ) +var ( + skipInstall bool +) + // activateCmd represents the activate command var activateCmd = &cobra.Command{ Use: "activate [integration]", @@ -39,7 +43,7 @@ var activateCmd = &cobra.Command{ integration := integration.NewIntegration() // Check if the integation exists - err := integration.Activate(integrationName, namespace, activeFilters) + err := integration.Activate(integrationName, namespace, activeFilters, skipInstall) if err != nil { color.Red("Error: %v", err) return @@ -51,5 +55,6 @@ var activateCmd = &cobra.Command{ func init() { IntegrationCmd.AddCommand(activateCmd) + activateCmd.Flags().BoolVarP(&skipInstall, "no-install", "s", false, "Only activate the integration filter without installing the filter (for example, if that filter plugin is already deployed in cluster, we do not need to re-install it again)") } diff --git a/pkg/integration/integration.go b/pkg/integration/integration.go index 0e8b6c492b..e89e434c00 100644 --- a/pkg/integration/integration.go +++ b/pkg/integration/integration.go @@ -66,7 +66,7 @@ func (*Integration) Get(name string) (IIntegration, error) { return integrations[name], nil } -func (*Integration) Activate(name string, namespace string, activeFilters []string) error { +func (*Integration) Activate(name string, namespace string, activeFilters []string, skipInstall bool) error { if _, ok := integrations[name]; !ok { return errors.New("integration not found") } @@ -83,8 +83,10 @@ func (*Integration) Activate(name string, namespace string, activeFilters []stri viper.Set("active_filters", uniqueFilters) - if err := integrations[name].Deploy(namespace); err != nil { - return err + if !skipInstall { + if err := integrations[name].Deploy(namespace); err != nil { + return err + } } if err := viper.WriteConfig(); err != nil {