Skip to content

Commit 66b5955

Browse files
feat(cf-common): upd hpa tpl for custom metrics (#24)
1 parent 547e2c8 commit 66b5955

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

charts/cf-common-test/tests/hpa/spec_test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ tests:
7474
enabled: true
7575
minReplicas: 2
7676
maxReplicas: 10
77+
targetCPUUtilizationPercentage: 50
7778
metrics:
7879
- type: Object
7980
object:
@@ -89,4 +90,4 @@ tests:
8990
asserts:
9091
- lengthEqual:
9192
path: spec.metrics
92-
count: 1
93+
count: 2

charts/cf-common/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: v0.0.0
33
description: Codefresh library chart
44
name: cf-common
5-
version: 0.0.22
5+
version: 0.0.23
66
type: library
77
keywords:
88
- codefresh

charts/cf-common/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Codefresh library chart
44

5-
![Version: 0.0.22](https://img.shields.io/badge/Version-0.0.22-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.23](https://img.shields.io/badge/Version-0.0.23-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
1919
dependencies:
2020
- name: cf-common
21-
version: 0.0.22
21+
version: 0.0.23
2222
repository: https://chartmuseum.codefresh.io/cf-common
2323
```
2424

charts/cf-common/templates/render/_hpa.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ spec:
3838
metrics:
3939
{{- if .Values.hpa.metrics }}
4040
{{ toYaml .Values.hpa.metrics | indent 4 }}
41-
{{- else if (or .Values.hpa.targetMemoryUtilizationPercentage .Values.hpa.targetCPUUtilizationPercentage) }}
41+
{{- end }}
42+
{{- if (or .Values.hpa.targetMemoryUtilizationPercentage .Values.hpa.targetCPUUtilizationPercentage) }}
4243
{{- with .Values.hpa.targetMemoryUtilizationPercentage }}
4344
- type: Resource
4445
resource:

0 commit comments

Comments
 (0)