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
004c5bcc
Commit
004c5bcc
authored
Feb 08, 2017
by
Justin Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(helm): fix condition when no requirements.yaml exists during tag/condition processing
parent
faae1f68
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
2 deletions
+55
-2
requirements.go
pkg/chartutil/requirements.go
+8
-2
Chart.yaml
pkg/chartutil/testdata/subpop/noreqs/Chart.yaml
+5
-0
service.yaml
pkg/chartutil/testdata/subpop/noreqs/templates/service.yaml
+15
-0
values.yaml
pkg/chartutil/testdata/subpop/noreqs/values.yaml
+27
-0
No files found.
pkg/chartutil/requirements.go
View file @
004c5bcc
...
...
@@ -209,7 +209,13 @@ func ProcessRequirementsTags(reqs *Requirements, cvals Values) {
func
ProcessRequirementsEnabled
(
c
*
chart
.
Chart
,
v
*
chart
.
Config
)
error
{
reqs
,
err
:=
LoadRequirements
(
c
)
if
err
!=
nil
{
return
ErrRequirementsNotFound
// if not just missing requirements file, return error
if
nerr
,
ok
:=
err
.
(
ErrNoRequirementsFile
);
!
ok
{
return
nerr
}
else
{
// no requirements to process
return
nil
}
}
// set all to true
for
_
,
lr
:=
range
reqs
.
Dependencies
{
...
...
@@ -223,7 +229,7 @@ func ProcessRequirementsEnabled(c *chart.Chart, v *chart.Config) error {
ProcessRequirementsTags
(
reqs
,
cvals
)
ProcessRequirementsConditions
(
reqs
,
cvals
)
// make a map of charts to
keep
// make a map of charts to
remove
rm
:=
map
[
string
]
bool
{}
for
_
,
r
:=
range
reqs
.
Dependencies
{
if
!
r
.
Enabled
{
...
...
pkg/chartutil/testdata/subpop/noreqs/Chart.yaml
0 → 100644
View file @
004c5bcc
apiVersion
:
v1
description
:
A Helm chart for Kubernetes
name
:
parentchart
version
:
0.1.0
\ No newline at end of file
pkg/chartutil/testdata/subpop/noreqs/templates/service.yaml
0 → 100644
View file @
004c5bcc
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
.Chart.Name
}}
labels
:
chart
:
"
{{
.Chart.Name
}}-{{
.Chart.Version
}}"
spec
:
type
:
{{
.Values.service.type
}}
ports
:
-
port
:
{{
.Values.service.externalPort
}}
targetPort
:
{{
.Values.service.internalPort
}}
protocol
:
TCP
name
:
{{
.Values.service.name
}}
selector
:
app
:
{{
.Chart.Name
}}
pkg/chartutil/testdata/subpop/noreqs/values.yaml
0 → 100644
View file @
004c5bcc
# Default values for subchart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount
:
1
image
:
repository
:
nginx
tag
:
stable
pullPolicy
:
IfNotPresent
service
:
name
:
nginx
type
:
ClusterIP
externalPort
:
80
internalPort
:
80
resources
:
limits
:
cpu
:
100m
memory
:
128Mi
requests
:
cpu
:
100m
memory
:
128Mi
# switch-like
tags
:
front-end
:
true
back-end
:
false
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