From 9a6aad3ae4d739f086ad2e2d18db099d8375eff2 Mon Sep 17 00:00:00 2001 From: natasha41575 Date: Thu, 28 Jul 2022 14:52:24 -0500 Subject: [PATCH] allow colon in filenames --- kyaml/filesys/fsnode.go | 2 +- kyaml/filesys/fsnode_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kyaml/filesys/fsnode.go b/kyaml/filesys/fsnode.go index a5574b561..608b8e38a 100644 --- a/kyaml/filesys/fsnode.go +++ b/kyaml/filesys/fsnode.go @@ -569,7 +569,7 @@ func (n *fsNode) DebugPrint() { }) } -var legalFileNamePattern = regexp.MustCompile("^[a-zA-Z0-9-_.]+$") +var legalFileNamePattern = regexp.MustCompile("^[a-zA-Z0-9-_.:]+$") // This rules enforced here should be simpler and tighter // than what's allowed on a real OS. diff --git a/kyaml/filesys/fsnode_test.go b/kyaml/filesys/fsnode_test.go index 917c05beb..c73b4888e 100644 --- a/kyaml/filesys/fsnode_test.go +++ b/kyaml/filesys/fsnode_test.go @@ -34,6 +34,12 @@ var topCases = []pathCase{ arg: ParentDir, errStr: "illegal name '..' in file creation", }, + { + what: "colon", + arg: "a:b", + name: "a:b", + path: "a:b", + }, { what: "empty", arg: "",