From 14e513dd5eeffeafa56fe0ebd75290e309e48437 Mon Sep 17 00:00:00 2001 From: Andrea Tarocchi Date: Thu, 15 Feb 2024 22:18:42 +0100 Subject: [PATCH] chore(pkg/cmd/run.go): refactor usag of util.StringSliceContainsAnyOf where needed. --- pkg/cmd/run.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index 46f6cade3e..45805687c5 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -865,7 +865,7 @@ func (o *runCmdOptions) applyDependencies(cmd *cobra.Command, c client.Client, i func (o *runCmdOptions) getPlatform(cmd *cobra.Command, c client.Client, it *v1.Integration) (*v1.IntegrationPlatform, error) { // let's also enable the registry trait if not explicitly disabled - if !contains(o.Traits, "registry.enabled=false") { + if !util.StringSliceContainsAnyOf(o.Traits, "registry.enabled=false") { o.Traits = append(o.Traits, "registry.enabled=true") } pl, err := platform.GetForResource(o.Context, c, it) @@ -1385,13 +1385,3 @@ func getDirName(path string) (string, error) { } return parentDir, nil } - -func contains(s []string, str string) bool { - for _, v := range s { - if v == str { - return true - } - } - - return false -}