Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/cf-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v0.0.0
description: Codefresh library chart
name: cf-common
version: 0.8.0
version: 0.8.1
type: library
keywords:
- codefresh
Expand Down
4 changes: 2 additions & 2 deletions charts/cf-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Codefresh library chart

![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)
![Version: 0.8.1](https://img.shields.io/badge/Version-0.8.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)

## Installing the Chart

Expand All @@ -18,7 +18,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
# Chart.yaml
dependencies:
- name: cf-common
version: 0.8.0
version: 0.8.1
repository: https://chartmuseum.codefresh.io/cf-common
```

Expand Down
10 changes: 5 additions & 5 deletions charts/cf-common/templates/classic/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Calculate RabbitMQ URI (for On-Prem)
Must me called from chart root context.
Usage:
{{ include "cf-common-0.8.0.classic.calculateRabbitMqUri" . }}
{{ include "cf-common-0.8.1.classic.calculateRabbitMqUri" . }}
*/}}

{{- define "cf-common-0.8.0.classic.calculateRabbitMqUri" }}
{{- define "cf-common-0.8.1.classic.calculateRabbitMqUri" }}

{{- $rabbitmqProtocol := .Values.global.rabbitmqProtocol | default "amqp" -}}
{{- $rabbitmqUsername := .Values.global.rabbitmqUsername -}}
Expand All @@ -23,9 +23,9 @@ coalesce here for backward compatibility
{{/*
Calculate Mongo Uri (for On-Prem)
Usage:
{{ include "cf.common-0.8.0.classic.calculateMongoUri" (dict "dbName" $.Values.global.pipelineManagerService "mongoURI" $.Values.global.mongoURI) }}
{{ include "cf.common-0.8.1.classic.calculateMongoUri" (dict "dbName" $.Values.global.pipelineManagerService "mongoURI" $.Values.global.mongoURI) }}
*/}}
{{- define "cf-common-0.8.0.classic.calculateMongoUri" -}}
{{- define "cf-common-0.8.1.classic.calculateMongoUri" -}}
{{- if contains "?" .mongoURI -}}
{{- $mongoURI := (splitList "?" .mongoURI) -}}
{{- printf "%s%s?%s" (first $mongoURI) .dbName (last $mongoURI) }}
Expand All @@ -37,7 +37,7 @@ Usage:
{{/*
Calculate Consul host Uri (for On-Prem)
*/}}
{{- define "cf-common-0.8.0.classic.calculateConsulUri" }}
{{- define "cf-common-0.8.1.classic.calculateConsulUri" }}
{{- if .Values.global.consulHost }}
{{- printf "http://%s:%v" .Values.global.consulHost .Values.global.consulHttpPort -}}
{{- else }}
Expand Down
10 changes: 5 additions & 5 deletions charts/cf-common/templates/common/_annotations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
Render checksum annotation
Must be called from chart root context.
Usage:
annotations: {{ include "cf-common-0.8.0.annotations.podAnnotations" . | nindent }}
annotations: {{ include "cf-common-0.8.1.annotations.podAnnotations" . | nindent }}
*/}}
{{- define "cf-common-0.8.0.annotations.podAnnotations" -}}
{{- define "cf-common-0.8.1.annotations.podAnnotations" -}}

{{- if .Values.podAnnotations -}}
{{- include "cf-common-0.8.0.tplrender" (dict "Values" .Values.podAnnotations "context" $) | nindent 0 }}
{{- include "cf-common-0.8.1.tplrender" (dict "Values" .Values.podAnnotations "context" $) | nindent 0 }}
{{- end -}}

{{- $configMapFound := dict -}}
{{- range $configMapIndex, $configMapItem := .Values.configMaps -}}

{{- if $configMapItem.enabled -}}
{{- $_ := set $configMapFound $configMapIndex ( include "cf-common-0.8.0.tplrender" (dict "Values" $configMapItem.data "context" $) | sha256sum) -}}
{{- $_ := set $configMapFound $configMapIndex ( include "cf-common-0.8.1.tplrender" (dict "Values" $configMapItem.data "context" $) | sha256sum) -}}
{{- end -}}

{{- if $configMapFound -}}
Expand All @@ -27,7 +27,7 @@ annotations: {{ include "cf-common-0.8.0.annotations.podAnnotations" . | nindent
{{- range $secretIndex, $secretItem := .Values.secrets -}}

{{- if $secretItem.enabled -}}
{{- $_ := set $secretFound $secretIndex ( include "cf-common-0.8.0.tplrender" (dict "Values" $secretItem.stringData "context" $) | sha256sum) -}}
{{- $_ := set $secretFound $secretIndex ( include "cf-common-0.8.1.tplrender" (dict "Values" $secretItem.stringData "context" $) | sha256sum) -}}
{{- end -}}

{{- if $secretFound -}}
Expand Down
18 changes: 9 additions & 9 deletions charts/cf-common/templates/common/_labels.tpl
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{{/*
Kubernetes standard labels
*/}}
{{- define "cf-common-0.8.0.labels.standard" -}}
app.kubernetes.io/name: {{ include "cf-common-0.8.0.names.name" . }}
helm.sh/chart: {{ include "cf-common-0.8.0.names.chart" . }}
{{- define "cf-common-0.8.1.labels.standard" -}}
app.kubernetes.io/name: {{ include "cf-common-0.8.1.names.name" . }}
helm.sh/chart: {{ include "cf-common-0.8.1.names.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "cf-common-0.8.0.labels.matchLabels" -}}
app.kubernetes.io/name: {{ include "cf-common-0.8.0.names.name" . }}
{{- define "cf-common-0.8.1.labels.matchLabels" -}}
app.kubernetes.io/name: {{ include "cf-common-0.8.1.names.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}


{{/*
Extra labels
Usage:
{{ include "cf-common-0.8.0.labels.extraLabels" ( dict "Values" .Values.path.to.the.labels "context" $) }}
{{ include "cf-common-0.8.1.labels.extraLabels" ( dict "Values" .Values.path.to.the.labels "context" $) }}
*/}}
{{- define "cf-common-0.8.0.labels.extraLabels" -}}
{{- define "cf-common-0.8.1.labels.extraLabels" -}}
{{- if not (kindIs "map" .Values) -}}
{{- fail "ERROR: labels block must be a map" -}}
{{- end -}}
Expand All @@ -34,9 +34,9 @@ Usage:
{{/*
Annotations
Usage:
{{ include "cf-common-0.8.0.annotations" ( dict "Values" .Values.path.to.the.annotations "context" $) }}
{{ include "cf-common-0.8.1.annotations" ( dict "Values" .Values.path.to.the.annotations "context" $) }}
*/}}
{{- define "cf-common-0.8.0.annotations" -}}
{{- define "cf-common-0.8.1.annotations" -}}
{{- if not (kindIs "map" .Values) -}}
{{- fail "ERROR: annotations block must be a map" -}}
{{- end -}}
Expand Down
10 changes: 5 additions & 5 deletions charts/cf-common/templates/common/_names.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "cf-common-0.8.0.names.name" -}}
{{- define "cf-common-0.8.1.names.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cf-common-0.8.0.names.chart" -}}
{{- define "cf-common-0.8.1.names.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

Expand All @@ -17,7 +17,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "cf-common-0.8.0.names.fullname" -}}
{{- define "cf-common-0.8.1.names.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand All @@ -33,10 +33,10 @@ If release name contains chart name it will be used as a full name.
{{/*
ServiceAccount Name
*/}}
{{- define "cf-common-0.8.0.names.serviceAccountName" -}}
{{- define "cf-common-0.8.1.names.serviceAccountName" -}}
{{- if .Values.serviceAccount -}}
{{- if .Values.serviceAccount.enabled -}}
{{- .Values.serviceAccount.nameOverride | default (include "cf-common-0.8.0.names.fullname" .) -}}
{{- .Values.serviceAccount.nameOverride | default (include "cf-common-0.8.1.names.fullname" .) -}}
{{- else -}}
{{- print "default" -}}
{{- end -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/cf-common/templates/common/_tpl.tpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{/*
Renders a value that contains template.
Usage:
{{ include "cf-common-0.8.0.tplrender" ( dict "Values" .Values.path.to.the.Value "context" $) }}
{{ include "cf-common-0.8.1.tplrender" ( dict "Values" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "cf-common-0.8.0.tplrender" -}}
{{- define "cf-common-0.8.1.tplrender" -}}
{{- $tpl := .Values -}}
{{- if not (typeIs "string" $tpl) -}}
{{- $tpl = toYaml $tpl -}}
Expand Down
24 changes: 12 additions & 12 deletions charts/cf-common/templates/container/_container.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
Renders main container in pod template.
Called from pod template.
Usage:
{{ include "cf-common-0.8.0.container" (dict "Values" .Values.container "context" $) }}
{{ include "cf-common-0.8.1.container" (dict "Values" .Values.container "context" $) }}
*/}}
{{- define "cf-common-0.8.0.container" -}}
{{- define "cf-common-0.8.1.container" -}}

{{/* Restoring root $ context */}}
{{- $ := .context -}}

{{- $containerName := include "cf-common-0.8.0.names.fullname" $ -}}
{{- $containerName := include "cf-common-0.8.1.names.fullname" $ -}}
{{- if and (hasKey .Values "nameOverride") .Values.nameOverride }}
{{- $containerName = include "cf-common-0.8.0.tplrender" (dict "Values" .Values.nameOverride "context" $) -}}
{{- $containerName = include "cf-common-0.8.1.tplrender" (dict "Values" .Values.nameOverride "context" $) -}}
{{- end }}

- name: {{ $containerName }}
image: {{ include "cf-common-0.8.0.image.name" (dict "image" .Values.image "context" $) }}
image: {{ include "cf-common-0.8.1.image.name" (dict "image" .Values.image "context" $) }}
imagePullPolicy: {{ .Values.image.pullPolicy | default "Always" }}

{{- with .Values.command }}
{{- if not (kindIs "slice" .) }}
{{- fail "ERROR: container.command block must be a list!" }}
{{- end }}
command: {{- include "cf-common-0.8.0.tplrender" (dict "Values" . "context" $) | nindent 2 }}
command: {{- include "cf-common-0.8.1.tplrender" (dict "Values" . "context" $) | nindent 2 }}
{{- end }}

{{- with .Values.args }}
Expand Down Expand Up @@ -52,12 +52,12 @@ Usage:
{{- if not (kindIs "slice" .) }}
{{ fail "ERROR: container.envFrom block must be a list!"}}
{{- end }}
{{- include "cf-common-0.8.0.tplrender" (dict "Values" . "context" $) | trim | nindent 4 }}
{{- include "cf-common-0.8.1.tplrender" (dict "Values" . "context" $) | trim | nindent 4 }}
{{- end }}
{{- range $secretName, $secretItem := $.Values.secrets }}
{{- if $secretItem.enabled }}
- secretRef:
name: {{ printf "%s-%s" (include "cf-common-0.8.0.names.fullname" $) $secretName }}
name: {{ printf "%s-%s" (include "cf-common-0.8.1.names.fullname" $) $secretName }}
{{- end }}
{{- end }}
{{- end }}
Expand All @@ -74,10 +74,10 @@ For backward compatibility (.Values.env takes precedence over .Values.container.
{{- $mergedEnv = merge $mergedEnv $.Values.global.env }}
{{- end }}
env:
{{- include "cf-common-0.8.0.env-vars" (dict "Values" $mergedEnv "context" $) | trim | nindent 2 }}
{{- include "cf-common-0.8.1.env-vars" (dict "Values" $mergedEnv "context" $) | trim | nindent 2 }}
{{- end }}

{{- include "cf-common-0.8.0.ports" $ | trim | nindent 2 }}
{{- include "cf-common-0.8.1.ports" $ | trim | nindent 2 }}

{{- /*
For backward compatibility (.Values.volumeMounts takes precedence over .Values.container.volumeMounts)
Expand All @@ -86,10 +86,10 @@ For backward compatibility (.Values.volumeMounts takes precedence over .Values.c
{{- if $.Values.volumeMounts }}
{{- $mergedVolumeMounts = mergeOverwrite $mergedVolumeMounts $.Values.volumeMounts }}
{{- end }}
volumeMounts: {{ include "cf-common-0.8.0.volumeMounts" (dict "Values" $mergedVolumeMounts "context" $) | trim | nindent 2 }}
volumeMounts: {{ include "cf-common-0.8.1.volumeMounts" (dict "Values" $mergedVolumeMounts "context" $) | trim | nindent 2 }}

{{- with .Values.probes }}
{{- include "cf-common-0.8.0.probes" . | trim | nindent 2 }}
{{- include "cf-common-0.8.1.probes" . | trim | nindent 2 }}
{{- end }}

{{- with .Values.resources }}
Expand Down
6 changes: 3 additions & 3 deletions charts/cf-common/templates/container/_env_vars.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
Renders env vars in container template.
Called from container template.
Usage:
env: {{ include "cf-common-0.8.0.env-vars" (dict "Values" .Values.container.env "context" $) | nindent }}
env: {{ include "cf-common-0.8.1.env-vars" (dict "Values" .Values.container.env "context" $) | nindent }}
*/}}
{{- define "cf-common-0.8.0.env-vars"}}
{{- define "cf-common-0.8.1.env-vars"}}
{{- $ := .context }}
{{- if .Values }}
{{- if not (kindIs "map" .Values) }}
{{ fail "ERROR: env block must be a map"}}
{{- end }}
{{- end }}
{{- $env := .Values }}
{{- $templatedEnv := include "cf-common-0.8.0.tplrender" (dict "Values" $env "context" $) | fromYaml }}
{{- $templatedEnv := include "cf-common-0.8.1.tplrender" (dict "Values" $env "context" $) | fromYaml }}
{{- range $name, $val := $templatedEnv }}
{{- if or (kindIs "string" $val) (kindIs "bool" $val) (kindIs "int" $val) (kindIs "float64" $val) }}
- name: {{ $name }}
Expand Down
12 changes: 6 additions & 6 deletions charts/cf-common/templates/container/_image.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Prints full image name.
Called from container template.
Usage:
{{ include "cf-common-0.8.0.image.name" (dict "image" .Values.container.image "context" $) }}
{{ include "cf-common-0.8.1.image.name" (dict "image" .Values.container.image "context" $) }}
*/}}
{{- define "cf-common-0.8.0.image.name" -}}
{{- define "cf-common-0.8.1.image.name" -}}

{{/* Restoring root $ context */}}
{{- $ := .context -}}
Expand Down Expand Up @@ -56,9 +56,9 @@ For backward compatibility (onprem with private docker registry)
Prints full image name.
Must be called from chart root context.
Usage:
{{ include "cf-common-0.8.0.image.pullSecrets" . }}
{{ include "cf-common-0.8.1.image.pullSecrets" . }}
*/}}
{{- define "cf-common-0.8.0.image.pullSecrets" -}}
{{- define "cf-common-0.8.1.image.pullSecrets" -}}
{{- $pullSecrets := list }}

{{- if .Values.global.imagePullSecrets }}
Expand All @@ -67,7 +67,7 @@ Usage:
{{- end -}}

{{- range .Values.global.imagePullSecrets -}}
{{- $pullSecrets = append $pullSecrets (include "cf-common-0.8.0.tplrender" (dict "Values" . "context" $)) -}}
{{- $pullSecrets = append $pullSecrets (include "cf-common-0.8.1.tplrender" (dict "Values" . "context" $)) -}}
{{- end -}}
{{- end -}}

Expand All @@ -77,7 +77,7 @@ Usage:
{{- end -}}

{{- range .Values.imagePullSecrets -}}
{{- $pullSecrets = append $pullSecrets (include "cf-common-0.8.0.tplrender" (dict "Values" . "context" $)) -}}
{{- $pullSecrets = append $pullSecrets (include "cf-common-0.8.1.tplrender" (dict "Values" . "context" $)) -}}
{{- end -}}
{{- end -}}

Expand Down
4 changes: 2 additions & 2 deletions charts/cf-common/templates/container/_ports.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Renders ports map in container. Ports are obtained from .Values.service
Called from container template.
Usage:
ports: {{- include "cf-common-0.8.0.ports" $ | nindent }}
ports: {{- include "cf-common-0.8.1.ports" $ | nindent }}
*/}}

{{- define "cf-common-0.8.0.ports" -}}
{{- define "cf-common-0.8.1.ports" -}}

{{- $ports := list -}}
{{- range $serviceName, $serviceItem := .Values.service }}
Expand Down
4 changes: 2 additions & 2 deletions charts/cf-common/templates/container/_probes.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Renders probes map in container.
Called from container template.
Usage:
probes: {{ include "cf-common-0.8.0.probes" .Values.container.probes | nindent 2 }}
probes: {{ include "cf-common-0.8.1.probes" .Values.container.probes | nindent 2 }}
*/}}
{{- define "cf-common-0.8.0.probes" -}}
{{- define "cf-common-0.8.1.probes" -}}

{{- range $probeName, $probeItem := . }}

Expand Down
8 changes: 5 additions & 3 deletions charts/cf-common/templates/container/_volumemounts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Renders volumeMounts list in container.
Called from container template.
Usage:
volumeMounts: {{- include "cf-common-0.8.0.volumeMounts" (dict "Values" .Values.container.volumeMounts "context" $) | nindent 2 }}
volumeMounts: {{- include "cf-common-0.8.1.volumeMounts" (dict "Values" .Values.container.volumeMounts "context" $) | nindent 2 }}
*/}}

{{- define "cf-common-0.8.0.volumeMounts" -}}
{{- define "cf-common-0.8.1.volumeMounts" -}}
{{/* Restoring root $ context */}}
{{- $ := .context -}}

Expand Down Expand Up @@ -46,14 +46,16 @@ volumeMounts: {{- include "cf-common-0.8.0.volumeMounts" (dict "Values" .Values.

{{- end }}

{{- if eq $.Values.controller.type "statefulset" }}
{{- if $.Values.controller }}
{{- if eq $.Values.controller.type "statefulset" }}
{{- range $claimIndex, $claimItem := $.Values.volumeClaimTemplates }}
- mountPath: {{ $claimItem.mountPath }}
name: {{ $claimIndex }}
{{- if $claimItem.subPath }}
subPath: {{ $claimItem.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

{{- end -}}
Loading