Try to use brackets
- it: annotations validation asserts: - equal: path: metadata.annotations["helm.sh/hook"] pattern: pre-upgrade