Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable dynamic treatment of verbatim strings as YAML #27

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

porridge
Copy link
Contributor

It turns out there is another surprise layer of YAML unmashalling in this code, which only pops up if the value does look like valid YAML. 🤦🏻

The changed test case fails with the following diff (note the foo: bar crawling up to the parent level!). The associated code changes prevent this.

 apiVersion: v1
 data:
-  foo: true
   hba.conf: |-
     # PostgreSQL Client Authentication Configuration File
     local   all             all                                     scram-sha-256
   postgresql.conf: |
     hba_file = '/etc/stackrox.d/config/pg_hba.conf'
     foo = "bar"
 
     log_timezone = 'Etc/UTC' # comment
     more = false
+  yaml_looking_file: |-
+    foo: true
+    bar: baz
 kind: ConfigMap
 metadata:
   name: a-cm
   namespace: stackrox

@porridge porridge requested a review from ludydoo February 24, 2025 09:58
@porridge porridge changed the title Verbatim fix fix: disable dynamic treatment of verbatim strings as YAML Feb 24, 2025
@porridge porridge merged commit 13b5b47 into main Feb 24, 2025
1 check passed
@porridge porridge deleted the verbatim-fix branch February 24, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants