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
1360e320
Commit
1360e320
authored
Dec 05, 2016
by
Matt Butcher
Committed by
GitHub
Dec 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1635 from johnhofman/fix/helper-template-trimSuffix
fix(helm): add trimSuffix to helper functions
parents
6f891ea8
c38fb120
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
_helpers.tpl
docs/examples/nginx/templates/_helpers.tpl
+2
-2
create.go
pkg/chartutil/create.go
+2
-2
_helpers.tpl
pkg/lint/rules/testdata/albatross/templates/_helpers.tpl
+2
-2
No files found.
docs/examples/nginx/templates/_helpers.tpl
View file @
1360e320
...
...
@@ -2,7 +2,7 @@
{
{
/*
Expand
the
name
of
the
chart
.
*/
}
}
{
{
define
"name"
}
}{
{
default
"nginx"
.
Values
.
nameOverride
|
trunc
24
}
}{
{
end
}
}
{
{
define
"name"
}
}{
{
default
"nginx"
.
Values
.
nameOverride
|
trunc
24
|
trimSuffix
"-"
}
}{
{
end
}
}
{
{
/*
Create
a
default
fully
qualified
app
name
.
...
...
@@ -12,5 +12,5 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/
}
}
{
{
define
"fullname"
}
}
{{- $name := default "nginx" .Values.nameOverride -}}
{
{
printf
"%s-%s"
.
Release
.
Name
$name
|
trunc
24
-
}
}
{
{
printf
"%s-%s"
.
Release
.
Name
$name
|
trunc
24
|
trimSuffix
"-"
-
}
}
{
{
end
}
}
pkg/chartutil/create.go
View file @
1360e320
...
...
@@ -162,7 +162,7 @@ const defaultHelpers = `{{/* vim: set filetype=mustache: */}}
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24
| trimSuffix "-"
-}}
{{- end -}}
{{/*
...
...
@@ -171,7 +171,7 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24
| trimSuffix "-"
-}}
{{- end -}}
`
...
...
pkg/lint/rules/testdata/albatross/templates/_helpers.tpl
View file @
1360e320
...
...
@@ -2,7 +2,7 @@
{
{
/*
Expand
the
name
of
the
chart
.
*/
}
}
{
{
define
"name"
}
}{
{
default
"nginx"
.
Values
.
nameOverride
|
trunc
24
}
}{
{
end
}
}
{
{
define
"name"
}
}{
{
default
"nginx"
.
Values
.
nameOverride
|
trunc
24
|
trimSuffix
"-"
}
}{
{
end
}
}
{
{
/*
Create
a
default
fully
qualified
app
name
.
...
...
@@ -12,5 +12,5 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/
}
}
{
{
define
"fullname"
}
}
{{- $name := default "nginx" .Values.nameOverride -}}
{
{
printf
"%s-%s"
.
Release
.
Name
$name
|
trunc
24
-
}
}
{
{
printf
"%s-%s"
.
Release
.
Name
$name
|
trunc
24
|
trimSuffix
"-"
-
}
}
{
{
end
}
}
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