Skip to content

Commit

Permalink
chore(pkg/cmd/run.go): refactor usag of util.StringSliceContainsAnyOf…
Browse files Browse the repository at this point in the history
… where needed.
  • Loading branch information
valdar committed May 8, 2024
1 parent b9b95f7 commit 1819d29
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,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)
Expand Down Expand Up @@ -1398,13 +1398,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
}

0 comments on commit 1819d29

Please sign in to comment.