This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/master by this push:
     new 10d0b80  sanitize name of auto-generated catalogs
10d0b80 is described below

commit 10d0b8046b7ef2d65835bf69cbe3b074d3cd6c79
Author: lburgazzoli <lburgazz...@gmail.com>
AuthorDate: Thu Sep 26 09:34:03 2019 +0200

    sanitize name of auto-generated catalogs
---
 pkg/trait/camel.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 29f66b2..7cfbc9d 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -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"
@@ -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

Reply via email to