Files
application/backing-services/zot/unittests/secret_checksum_test.yaml
2025-11-09 13:22:40 +03:30

26 lines
930 B
YAML

suite: secret checksum in deployment
# Can't use global templates in this test suite as it will break the checksum calculation
# causing false negative test outcome.
# templates:
# - deployment.yaml
tests:
- it: has no checksum/secret if no config
template: deployment.yaml
asserts:
- isNull:
path: spec.template.metadata.annotations.checksum/secret
- it: generate checksum/secret if config is present
template: deployment.yaml
set:
mountSecret: true
secretFiles:
htpasswd: |-
admin:$2y$05$vmiurPmJvHylk78HHFWuruFFVePlit9rZWGA/FbZfTEmNRneGJtha
user:$2y$05$L86zqQDfH5y445dcMlwu6uHv.oXFgT6AiJCwpv3ehr7idc0rI3S2G
asserts:
- isNotNull:
path: spec.template.metadata.annotations.checksum/secret
- matchRegex:
path: spec.template.metadata.annotations.checksum/secret
pattern: "^[a-f0-9]{64}$" # SHA256 hex output