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
b3536812
Unverified
Commit
b3536812
authored
Apr 30, 2018
by
Matthew Fisher
Committed by
GitHub
Apr 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3988 from kubernetes/revert-3837-toYaml-pr
Revert "toYaml - Fix #3470 and #3410's trailing \n issues"
parents
68714865
f7f686f7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
files.go
pkg/chartutil/files.go
+1
-1
files_test.go
pkg/chartutil/files_test.go
+4
-4
parser.go
pkg/strvals/parser.go
+1
-1
parser_test.go
pkg/strvals/parser_test.go
+1
-1
No files found.
pkg/chartutil/files.go
View file @
b3536812
...
...
@@ -175,7 +175,7 @@ func ToYaml(v interface{}) string {
// Swallow errors inside of a template.
return
""
}
return
string
s
.
TrimSuffix
(
string
(
data
),
"
\n
"
)
return
string
(
data
)
}
// FromYaml converts a YAML document into a map[string]interface{}.
...
...
pkg/chartutil/files_test.go
View file @
b3536812
...
...
@@ -72,10 +72,10 @@ func TestToConfig(t *testing.T) {
f
:=
NewFiles
(
getTestFiles
())
out
:=
f
.
Glob
(
"**/captain.txt"
)
.
AsConfig
()
as
.
Equal
(
"captain.txt: The Captain"
,
out
)
as
.
Equal
(
"captain.txt: The Captain
\n
"
,
out
)
out
=
f
.
Glob
(
"ship/**"
)
.
AsConfig
()
as
.
Equal
(
"captain.txt: The Captain
\n
stowaway.txt: Legatt"
,
out
)
as
.
Equal
(
"captain.txt: The Captain
\n
stowaway.txt: Legatt
\n
"
,
out
)
}
func
TestToSecret
(
t
*
testing
.
T
)
{
...
...
@@ -84,7 +84,7 @@ func TestToSecret(t *testing.T) {
f
:=
NewFiles
(
getTestFiles
())
out
:=
f
.
Glob
(
"ship/**"
)
.
AsSecrets
()
as
.
Equal
(
"captain.txt: VGhlIENhcHRhaW4=
\n
stowaway.txt: TGVnYXR0"
,
out
)
as
.
Equal
(
"captain.txt: VGhlIENhcHRhaW4=
\n
stowaway.txt: TGVnYXR0
\n
"
,
out
)
}
func
TestLines
(
t
*
testing
.
T
)
{
...
...
@@ -99,7 +99,7 @@ func TestLines(t *testing.T) {
}
func
TestToYaml
(
t
*
testing
.
T
)
{
expect
:=
"foo: bar"
expect
:=
"foo: bar
\n
"
v
:=
struct
{
Foo
string
`json:"foo"`
}{
...
...
pkg/strvals/parser.go
View file @
b3536812
...
...
@@ -36,7 +36,7 @@ func ToYAML(s string) (string, error) {
return
""
,
err
}
d
,
err
:=
yaml
.
Marshal
(
m
)
return
string
s
.
TrimSuffix
(
string
(
d
),
"
\n
"
),
err
return
string
(
d
),
err
}
// Parse parses a set line.
...
...
pkg/strvals/parser_test.go
View file @
b3536812
...
...
@@ -370,7 +370,7 @@ func TestToYAML(t *testing.T) {
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
expect
:=
"name: value"
expect
:=
"name: value
\n
"
if
o
!=
expect
{
t
.
Errorf
(
"Expected %q, got %q"
,
expect
,
o
)
}
...
...
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