Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
15ef839f
Commit
15ef839f
authored
Aug 07, 2018
by
Mike Lundy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[manifests] hoist the regex out of SplitManifests
parent
0a9c16f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
splitter.go
pkg/manifest/splitter.go
+5
-2
No files found.
pkg/manifest/splitter.go
View file @
15ef839f
...
...
@@ -23,14 +23,17 @@ import (
"k8s.io/helm/pkg/releaseutil"
)
var
(
kindRegex
=
regexp
.
MustCompile
(
"kind:(.*)
\n
"
)
)
// SplitManifests takes a map of rendered templates and splits them into the
// detected manifests.
func
SplitManifests
(
templates
map
[
string
]
string
)
[]
Manifest
{
var
listManifests
[]
Manifest
// extract kind and name
re
:=
regexp
.
MustCompile
(
"kind:(.*)
\n
"
)
for
k
,
v
:=
range
templates
{
match
:=
re
.
FindStringSubmatch
(
v
)
match
:=
kindRegex
.
FindStringSubmatch
(
v
)
h
:=
"Unknown"
if
len
(
match
)
==
2
{
h
=
strings
.
TrimSpace
(
match
[
1
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment