Commit 004c5bcc authored by Justin Scott's avatar Justin Scott

feat(helm): fix condition when no requirements.yaml exists during tag/condition processing

parent faae1f68
...@@ -209,7 +209,13 @@ func ProcessRequirementsTags(reqs *Requirements, cvals Values) { ...@@ -209,7 +209,13 @@ func ProcessRequirementsTags(reqs *Requirements, cvals Values) {
func ProcessRequirementsEnabled(c *chart.Chart, v *chart.Config) error { func ProcessRequirementsEnabled(c *chart.Chart, v *chart.Config) error {
reqs, err := LoadRequirements(c) reqs, err := LoadRequirements(c)
if err != nil { 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 // set all to true
for _, lr := range reqs.Dependencies { for _, lr := range reqs.Dependencies {
...@@ -223,7 +229,7 @@ func ProcessRequirementsEnabled(c *chart.Chart, v *chart.Config) error { ...@@ -223,7 +229,7 @@ func ProcessRequirementsEnabled(c *chart.Chart, v *chart.Config) error {
ProcessRequirementsTags(reqs, cvals) ProcessRequirementsTags(reqs, cvals)
ProcessRequirementsConditions(reqs, cvals) ProcessRequirementsConditions(reqs, cvals)
// make a map of charts to keep // make a map of charts to remove
rm := map[string]bool{} rm := map[string]bool{}
for _, r := range reqs.Dependencies { for _, r := range reqs.Dependencies {
if !r.Enabled { if !r.Enabled {
......
apiVersion: v1
description: A Helm chart for Kubernetes
name: parentchart
version: 0.1.0
\ No newline at end of file
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 }}
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment