You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/06/03 15:10:08 UTC

[camel-k] 01/01: sanitized integration name on Windows contains whole path

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

acosentino pushed a commit to branch sanitize-name-fix
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit dcb5d6f394e42363620ddc71beea6f4e76f5a408
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 3 17:09:46 2020 +0200

    sanitized integration name on Windows contains whole path
---
 pkg/util/kubernetes/sanitize.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/util/kubernetes/sanitize.go b/pkg/util/kubernetes/sanitize.go
index 1ed8026..c7f5fed 100644
--- a/pkg/util/kubernetes/sanitize.go
+++ b/pkg/util/kubernetes/sanitize.go
@@ -18,7 +18,7 @@ limitations under the License.
 package kubernetes
 
 import (
-	"path"
+	"path/filepath"
 	"regexp"
 	"strings"
 	"unicode"
@@ -30,7 +30,7 @@ var disallowedChars = regexp.MustCompile(`[^a-z0-9-]`)
 
 // SanitizeName sanitizes the given name to be compatible with k8s
 func SanitizeName(name string) string {
-	name = path.Base(name)
+	name = filepath.Base(name)
 	name = strings.Split(name, ".")[0]
 	name = scase.KebabCase(name)
 	name = strings.ToLower(name)