File tree Expand file tree Collapse file tree 7 files changed +37
-27
lines changed Expand file tree Collapse file tree 7 files changed +37
-27
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ apiVersion: v2
22appVersion : v0.0.0
33description : Codefresh library chart
44name : cf-common
5- version : 0.0.20
5+ version : 0.0.21
66type : library
77keywords :
88 - codefresh
Original file line number Diff line number Diff line change 22
33Codefresh library chart
44
5- ![ Version: 0.0.20 ] ( https://img.shields.io/badge/Version-0.0.20 -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 )
5+ ![ Version: 0.0.21 ] ( https://img.shields.io/badge/Version-0.0.21 -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 )
66
77## Installing the Chart
88
@@ -18,7 +18,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
1818# Chart.yaml
1919dependencies :
2020- name : cf-common
21- version : 0.0.20
21+ version : 0.0.21
2222 repository : https://chartmuseum.codefresh.io/cf-common
2323` ` `
2424
@@ -75,6 +75,7 @@ dependencies:
7575| controller.job.suspend | string | `nil` | Suspend specifies whether the Job controller should create Pods or not. (boolean) |
7676| controller.job.ttlSecondsAfterFinished | string | `nil` | Set the limit on the lifetime of a Job that has finished execution (either Complete or Failed). (int) |
7777| controller.labels | object | `{}` | Set labels on controller |
78+ | controller.nameOverride | string | `""` | Override the name suffix that is used for this controller |
7879| controller.replicas | string | `nil` | Set number of pods |
7980| controller.revisionHistoryLimit | string | `nil` | Set ReplicaSet revision history limit |
8081| controller.rollout.analysis.successfulRunHistoryLimit | string | `nil` | Limits the number of successful analysis runs and experiments to be stored in a history |
Original file line number Diff line number Diff line change 88
99{ {- if .Values.controller.enabled -} }
1010
11- { { include " cf-common.controller.type" . } }
11+ { {- $defaultControllerValues := deepCopy .Values.controller -} }
12+ { {- $globalControllerValues := dict -} }
13+ { {- if .Values.global -} }
14+ { {- if .Values.global.controller -} }
15+ { {- $globalControllerValues = deepCopy .Values.global.controller -} }
16+ { {- end -} }
17+ { {- end -} }
18+ { {- $mergedControllerValues := mergeOverwrite $globalControllerValues $defaultControllerValues -} }
19+ { {- $_ := set .Values " controller" (deepCopy $mergedControllerValues ) -} }
1220
1321 { {- if eq .Values.controller.type " rollout" } }
1422 { { include " cf-common.controller.rollout" . | nindent 0 } }
@@ -25,22 +33,3 @@ Usage:
2533{ {- end -} }
2634
2735{ {- end -} }
28-
29-
30- { {- /*
31- Define controller type. Merges .Values.controller (takes precedence) with .Values.global.controller
32- Usage:
33- {{ include " cf-common.controller.type" . } }
34- */}}
35-
36- { {- define " cf-common.controller.type" } }
37-
38- { {- $controllerDict := .Values.controller -} }
39- { {- if $.Values.global -} }
40- { {- if $.Values.global.controller -} }
41- { {- $controllerDict = merge $controllerDict $.Values.global.controller -} }
42- { {- end -} }
43- { {- end -} }
44- { {- $_ := set .Values " controller" $controllerDict -} }
45-
46- { {- end } }
Original file line number Diff line number Diff line change @@ -12,11 +12,16 @@ Usage:
1212 { {- fail (printf " ERROR: %s is invalid Deployment strategy!" $strategy ) -} }
1313{ {- end -} }
1414
15+ { {- $deploymentName := include " cf-common.names.fullname" . -} }
16+ { {- if and (hasKey .Values.controller " nameOverride" ) .Values.controller.nameOverride -} }
17+ { {- $deploymentName = printf " %v-%v" $deploymentName .Values.controller.nameOverride -} }
18+ { {- end -} }
19+
1520---
1621apiVersion: apps/v1
1722kind: Deployment
1823metadata:
19- name: { { include " cf-common.names.fullname " . } }
24+ name: { { $ deploymentName } }
2025 labels: { { include " cf-common.labels.standard" . | nindent 4 } }
2126 { {- if .Values.controller.labels } }
2227 { {- include " cf-common.tplrender" (dict " Values" .Values.controller.labels " context" $) | nindent 4 } }
Original file line number Diff line number Diff line change @@ -12,11 +12,16 @@ Usage:
1212 { {- fail (printf " ERROR: %s is invalid Rollout strategy!" $strategy ) -} }
1313{ {- end -} }
1414
15+ { {- $rolloutName := include " cf-common.names.fullname" . -} }
16+ { {- if and (hasKey .Values.controller " nameOverride" ) .Values.controller.nameOverride -} }
17+ { {- $rolloutName = printf " %v-%v" $rolloutName .Values.controller.nameOverride -} }
18+ { {- end -} }
19+
1520---
1621apiVersion: argoproj.io/v1alpha1
1722kind: Rollout
1823metadata:
19- name: { { include " cf-common.names.fullname " . } }
24+ name: { { $ rolloutName } }
2025 labels: { { include " cf-common.labels.standard" . | nindent 4 } }
2126 { {- if .Values.controller.labels } }
2227 { {- include " cf-common.tplrender" (dict " Values" .Values.controller.labels " context" $) | nindent 4 } }
3843 strategy:
3944 { {- if eq $strategy " Canary" } }
4045 { {- with .Values.controller.rollout } }
41- canary:
46+ canary:
4247 maxUnavailable: { { .canary.maxUnavailable } }
4348 maxSurge: { { .canary.maxSurge } }
4449 stableMetadata: { { .canary.stableMetadata| toYaml | nindent 8 } }
Original file line number Diff line number Diff line change 88
99{ {- if .Values.hpa.enabled -} }
1010
11- { { include " cf-common.controller.type" . } }
11+ { {- $defaultControllerValues := deepCopy .Values.controller -} }
12+ { {- $globalControllerValues := dict -} }
13+ { {- if .Values.global -} }
14+ { {- if .Values.global.controller -} }
15+ { {- $globalControllerValues = deepCopy .Values.global.controller -} }
16+ { {- end -} }
17+ { {- end -} }
18+ { {- $mergedControllerValues := mergeOverwrite $globalControllerValues $defaultControllerValues -} }
19+ { {- $_ := set .Values " controller" (deepCopy $mergedControllerValues ) -} }
1220
1321apiVersion: autoscaling/v2beta2
1422kind: HorizontalPodAutoscaler
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ controller:
8383 labels : {}
8484 # -- Set annotations on controller
8585 annotations : {}
86+ # -- Override the name suffix that is used for this controller
87+ nameOverride : " "
8688 # -- Set number of pods
8789 replicas :
8890 # -- Set ReplicaSet revision history limit
You can’t perform that action at this time.
0 commit comments