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

dyff yaml incorrectly converts boolstring to bool #309

Closed
ripta opened this issue Jun 26, 2023 · 1 comment
Closed

dyff yaml incorrectly converts boolstring to bool #309

ripta opened this issue Jun 26, 2023 · 1 comment

Comments

@ripta
Copy link

ripta commented Jun 26, 2023

Assuming in.yaml containing:

apiVersion: test/v1
kind: ReplicatedDatabase
metadata:
  name: customers
  annotations:
    prometheus.io/scrape: "true"
spec: {}

and then running dyff yaml in.yaml > out.yaml, I get the following content in out.yaml:

---
apiVersion: test/v1
kind: ReplicatedDatabase
metadata:
  name: customers
  annotations:
    prometheus.io/scrape: true
spec: {}

where unfortunately "true" (a string) is incorrectly converted into true (a bool). I'd have expected dyff to leave the type alone.

(Implementation detail: in Kubernetes, annotations are map[string]string, so the value must be treated as a string.)

HeavyWombat added a commit to gonvenience/neat that referenced this issue Jun 29, 2023
Ref: homeport/dyff#309

Make sure to properly quote reserved keywords.
@HeavyWombat
Copy link
Member

Thanks for bringing it up. I did not have much time lately for the projects, so sorry for the belated response. It should be fixed in the newest release. Let me know whether this works for you.

HeavyWombat added a commit to gonvenience/neat that referenced this issue Jan 7, 2025
Ref: homeport/dyff#309

Make sure to properly quote reserved keywords.
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

No branches or pull requests

2 participants