-
Notifications
You must be signed in to change notification settings - Fork 551
Open
Description
What happend
I was using pyyaml within ansible using the from_yaml_all
filter to download and deserialize the prometheus CRDs but it failed on this YAML manifest:
...
properties:
matchType:
enum:
- '!='
- = # <-- produces error
- =~
- '!~'
type: string
Error:
Failed to parse multi-document YAML: could not determine a constructor for the tag 'tag:yaml.org,2002:value'
in "<unicode string>", line 5658, column 29:
- =
How to reproduce:
Run this example:
import requests
import yaml
url = "https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.83.0/stripped-down-crds.yaml"
# Download the spec
response = requests.get(url)
response.raise_for_status()
# Parse multi-document YAML
documents = list(yaml.safe_load_all(response.text))
print("Parsed YAML documents:")
for i, doc in enumerate(documents, 1):
print(f"\nDocument {i}:")
print(doc)
Notes
I'm not sure if just having "=" as a string token is allowd by yaml spec, but other parsers handle this, so for compatibility pyyaml should probably also handle this
MichaelKorn
Metadata
Metadata
Assignees
Labels
No labels