Skip to content

Commit 78fcd10

Browse files
fix(cf-common): revert pod annotations (#16)
* fix(cf-common): revert pod annotations * empty commit * fix tests
1 parent 23c0a88 commit 78fcd10

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

charts/cf-common-test/tests/deployment/metadata_test.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
suite: deployment metadata
33
templates:
44
- templates/controller.yaml
5+
- templates/secret.yaml
6+
- templates/configmap.yaml
57
tests:
68
- it: Test deployment default metadata
9+
template: templates/controller.yaml
710
values:
811
- values.yaml
912
asserts:
@@ -25,6 +28,7 @@ tests:
2528
value: RELEASE-NAME-cf-common-test
2629

2730
- it: Test deployment custom metadata
31+
template: templates/controller.yaml
2832
values:
2933
- values.yaml
3034
set:
@@ -52,6 +56,7 @@ tests:
5256
alice: bob
5357

5458
- it: Test pod labels and annotations
59+
template: templates/controller.yaml
5560
values:
5661
- values.yaml
5762
set:
@@ -72,7 +77,7 @@ tests:
7277
- values.yaml
7378
set:
7479
podAnnotations:
75-
foo: bar
80+
checksum/config: '{{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}'
7681
configMaps:
7782
config:
7883
enabled: true
@@ -82,15 +87,15 @@ tests:
8287
- equal:
8388
path: spec.template.metadata.annotations
8489
value:
85-
foo: bar
86-
checksum/config: 6d1644995a0e1ef705e43f2f737e6adea7036bfceb82cc3bf468cc411a0ff77b
90+
checksum/config: de9d09f672fb2a4162f23792f202d4b078206a32d322d2b999fd822939397cb6
91+
template: templates/controller.yaml
8792

8893
- it: Test checksum/secret annotation
8994
values:
9095
- values.yaml
9196
set:
9297
podAnnotations:
93-
foo: bar
98+
checksum/secret: '{{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}'
9499
secrets:
95100
secret:
96101
enabled: true
@@ -100,5 +105,5 @@ tests:
100105
- equal:
101106
path: spec.template.metadata.annotations
102107
value:
103-
foo: bar
104-
checksum/secret: 8de97c7e45c17e43f84a9bda5428fe0bdf0be8fe12b99cb928c95a01cacfb85f
108+
checksum/secret: 22b7034621e9d062b0ca2a2d181ccaa21b537b480769384488b2e2b8d71e1cad
109+
template: templates/controller.yaml

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.15
5+
version: 0.0.16
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.15](https://img.shields.io/badge/Version-0.0.15-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.16](https://img.shields.io/badge/Version-0.0.16-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.15
21+
version: 0.0.16
2222
repository: https://chartmuseum.codefresh.io/cf-common
2323
```
2424

charts/cf-common/templates/controller/_deployment.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ spec:
5151
{{- if .Values.podLabels }}
5252
{{- include "cf-common.tplrender" (dict "Values" .Values.podLabels "context" $) | nindent 8 }}
5353
{{- end }}
54-
{{- with include "cf-common.annotations.podAnnotations" . }}
54+
{{- if .Values.podAnnotations }}
5555
annotations:
56-
{{- . | nindent 8}}
56+
{{- include "cf-common.tplrender" (dict "Values" .Values.podAnnotations "context" $) | nindent 8 }}
5757
{{- end }}
5858
spec: {{- include "cf-common.controller.pod" . | trim | nindent 6 -}}
5959
{{- end -}}

charts/cf-common/templates/controller/_rollout.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
strategy:
3939
{{- if eq $strategy "Canary" }}
4040
{{- with .Values.controller.rollout.canary }}
41-
canary:
41+
canary:
4242
maxUnavailable: {{ .maxUnavailable }}
4343
maxSurge: {{ .maxSurge }}
4444
stableMetadata: {{ .stableMetadata| toYaml | nindent 8 }}
@@ -52,9 +52,9 @@ spec:
5252
{{- if .Values.podLabels }}
5353
{{- include "cf-common.tplrender" (dict "Values" .Values.podLabels "context" $) | nindent 8 }}
5454
{{- end }}
55-
{{- with include "cf-common.annotations.podAnnotations" . }}
55+
{{- if .Values.podAnnotations }}
5656
annotations:
57-
{{- . | nindent 8}}
57+
{{- include "cf-common.tplrender" (dict "Values" .Values.podAnnotations "context" $) | nindent 8 }}
5858
{{- end }}
5959
spec: {{- include "cf-common.controller.pod" . | trim | nindent 6 -}}
6060
{{- end -}}

0 commit comments

Comments
 (0)