feat(common): Release library 3.7.0 (#377)

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
Co-authored-by: Patrick Collins <Patricol@users.noreply.github.com>
Co-authored-by: Patrick Collins <patrick.collins@gainbridge.io>
Co-authored-by: Lawrence Gil <larrywtf609@gmail.com>
Co-authored-by: solidDoWant <fred.heinecke@yahoo.com>
This commit is contained in:
Bernd Schorgers 2025-02-07 20:03:04 +01:00 committed by GitHub
parent aee0d999ba
commit 8b33237e27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 793 additions and 655 deletions

View file

@ -15,7 +15,7 @@ tests:
asserts:
- hasDocuments:
count: 2
- documentIndex: &ConfigmapDocument 1
- documentIndex: &ConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
@ -43,7 +43,7 @@ tests:
asserts:
- hasDocuments:
count: 2
- documentIndex: &ConfigmapDocument 1
- documentIndex: &ConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
@ -79,7 +79,7 @@ tests:
asserts:
- hasDocuments:
count: 2
- documentIndex: &ConfigmapDocument 1
- documentIndex: &ConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
@ -99,17 +99,39 @@ tests:
helm.sh/chart: common-test-1.0.0
test_label: test
- it: default configuration from folder with binary files should fail
set:
configMaps:
config:
data:
test: test
configMapsFromFolder:
enabled: true
basePath: ci/configMapsFolder
asserts:
- failedTemplate:
errorMessage: "There was an error loading ConfigMap: test_2. If it was automatically generated from a folder verify that files are properly flagged as `binary` or `escaped`"
- it: default metadata from folder should pass
set:
configMaps:
config:
data:
test: test
configMapsFromFolderBasePath: ci/configMapsFolder
configMapsFromFolder:
enabled: true
basePath: ci/configMapsFolder
configMapsOverrides:
test_2:
fileAttributeOverrides:
helm.jpg:
binary: true
test_2.yaml:
escaped: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &FirstConfigmapDocument 1
- documentIndex: &FirstConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *FirstConfigmapDocument
@ -123,7 +145,7 @@ tests:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- documentIndex: &SecondConfigmapDocument 2
- documentIndex: &SecondConfigmapDocument 1
isKind:
of: ConfigMap
- documentIndex: *SecondConfigmapDocument
@ -137,7 +159,7 @@ tests:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- documentIndex: &ThirdConfigmapDocument 3
- documentIndex: &ThirdConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *ThirdConfigmapDocument
@ -151,3 +173,66 @@ tests:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- it: custom metadata from folder should pass
set:
configMaps:
config:
data:
test: test
configMapsFromFolder:
enabled: true
basePath: ci/configMapsFolder
configMapsOverrides:
test_2:
labels:
test: test_label
annotations:
test: test_annotation
fileAttributeOverrides:
helm.jpg:
binary: true
test_2.yaml:
escaped: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &FirstConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *FirstConfigmapDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- documentIndex: &SecondConfigmapDocument 1
isKind:
of: ConfigMap
- documentIndex: *SecondConfigmapDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- documentIndex: &ThirdConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *ThirdConfigmapDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
test: test_label
- documentIndex: *ThirdConfigmapDocument
equal:
path: metadata.annotations
value:
test: test_annotation

View file

@ -42,13 +42,13 @@ tests:
asserts:
- hasDocuments:
count: 3
- documentIndex: &FirstConfigmapDocument 1
- documentIndex: &FirstConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *FirstConfigmapDocument
isNotNullOrEmpty:
path: metadata.name
- documentIndex: &SecondConfigmapDocument 2
- documentIndex: &SecondConfigmapDocument 1
isKind:
of: ConfigMap
- documentIndex: *SecondConfigmapDocument
@ -64,7 +64,7 @@ tests:
asserts:
- hasDocuments:
count: 2
- documentIndex: &ConfigmapDocument 1
- documentIndex: &ConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
@ -82,7 +82,7 @@ tests:
asserts:
- hasDocuments:
count: 2
- documentIndex: &ConfigmapDocument 1
- documentIndex: &ConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
@ -100,7 +100,7 @@ tests:
asserts:
- hasDocuments:
count: 2
- documentIndex: &ConfigmapDocument 1
- documentIndex: &ConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
@ -115,28 +115,82 @@ tests:
data:
test: test
nameOverride: "{{ .Release.Name }}"
configMapsFromFolderBasePath: ci/configMapsFolder
configMapsFromFolder:
enabled: true
basePath: ci/configMapsFolder
configMapsOverrides:
test_2:
fileAttributeOverrides:
helm.jpg:
binary: true
test_2.yaml:
escaped: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &FirstConfigmapDocument 1
- documentIndex: &FirstConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *FirstConfigmapDocument
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: &SecondConfigmapDocument 2
- documentIndex: &SecondConfigmapDocument 1
isKind:
of: ConfigMap
- documentIndex: *SecondConfigmapDocument
equal:
path: metadata.name
value: RELEASE-NAME-test_1
- documentIndex: &ThirdConfigmapDocument 3
- documentIndex: &ThirdConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *ThirdConfigmapDocument
equal:
path: metadata.name
value: RELEASE-NAME-test_2
- it: with templated nameOverride and from folder with forceRename should pass
set:
configMaps:
config:
data:
test: test
nameOverride: "{{ .Release.Name }}"
configMapsFromFolder:
enabled: true
basePath: ci/configMapsFolder
configMapsOverrides:
test_1:
forceRename: &newName1 newName1
test_2:
forceRename: &newName2 newName2
fileAttributeOverrides:
helm.jpg:
binary: true
test_2.yaml:
escaped: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &FirstConfigmapDocument 0
isKind:
of: ConfigMap
- documentIndex: *FirstConfigmapDocument
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: &SecondConfigmapDocument 1
isKind:
of: ConfigMap
- documentIndex: *SecondConfigmapDocument
equal:
path: metadata.name
value: *newName1
- documentIndex: &ThirdConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *ThirdConfigmapDocument
equal:
path: metadata.name
value: *newName2

View file

@ -25,7 +25,7 @@ tests:
data:
test: value 1
asserts:
- documentIndex: &ControllerDoc 0
- documentIndex: &ControllerDoc 3
isKind:
of: Deployment
- documentIndex: *ControllerDoc
@ -33,3 +33,41 @@ tests:
path: spec.template.metadata.annotations
value:
checksum/configMaps: 66d23d7a53c4e2a523ba85a969696b4ebb78ec5d79ab9c12c210c1569f48511b
- it: default metadata from folder should pass
set:
configMaps:
config:
enabled: true
data:
test: value 1
test_default_enabled:
data:
test: value 1
test_not_in_checksum:
includeInChecksum: false
data:
test: value 1
test_disabled:
enabled: false
data:
test: value 1
configMapsFromFolder:
enabled: true
basePath: ci/configMapsFolder
configMapsOverrides:
test_2:
fileAttributeOverrides:
helm.jpg:
binary: true
test_2.yaml:
escaped: true
asserts:
- documentIndex: &ControllerDoc 5
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: spec.template.metadata.annotations
value:
checksum/configMaps: e83a24569d0b4f2ccc44aec36d4e9a1c44a29bcc92eefdffe14fb1ce81dff054