Skip to content

Commit

Permalink
sanitize name of auto-generated catalogs
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Sep 26, 2019
1 parent 5ceee9f commit 10d0b80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/trait/camel.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path"
"regexp"
"strings"

"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/util/camel"
Expand Down Expand Up @@ -89,7 +90,10 @@ func (t *camelTrait) Apply(e *Environment) error {
return err
}

cx := v1alpha1.NewCamelCatalogWithSpecs(ns, "camel-catalog-"+cv, c.CamelCatalogSpec)
// sanitize catalog name
catalogName := "camel-catalog-" + strings.ToLower(cv)

cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, c.CamelCatalogSpec)
cx.Labels = make(map[string]string)
cx.Labels["app"] = "camel-k"
cx.Labels["camel.apache.org/catalog.version"] = cv
Expand Down

0 comments on commit 10d0b80

Please sign in to comment.