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

chore: use sigs.k8s.io/yaml/goyaml.v* instead of gopkg.in/yaml.v* #21273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmorel-35
Copy link
Contributor

Description

gomodguard allows to block some dependencies.

This ensure than gopkg.in/yaml.v2 and gopkg.in/yaml.v3 are not used anymore as sigs.k8s.io/yaml provides them both

@mmorel-35 mmorel-35 requested a review from a team as a code owner December 20, 2024 10:56
Copy link

bunnyshell bot commented Dec 20, 2024

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@mmorel-35 mmorel-35 force-pushed the gomodguard/yaml branch 6 times, most recently from 67cb14e to 2a7671b Compare December 20, 2024 22:54
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.23%. Comparing base (a807c0e) to head (0549978).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21273   +/-   ##
=======================================
  Coverage   55.22%   55.23%           
=======================================
  Files         337      337           
  Lines       56945    56945           
=======================================
+ Hits        31447    31451    +4     
+ Misses      22816    22814    -2     
+ Partials     2682     2680    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andrii-korotkov-verkada andrii-korotkov-verkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, there are some differences in how those handle things. E.g. time.Duration for sigs yaml is expected to be integer in nanoseconds, while for regular yaml it'd be in format like "1h".

@andrii-korotkov-verkada
Copy link
Contributor

Can you add a test with time duration parsing or point at the existing one, please?

@andrii-korotkov-verkada
Copy link
Contributor

Looks like it won't accept ints in new versions as duration https://github.com/kubernetes-sigs/yaml/blob/master/goyaml.v3/decode_test.go#L926. Looks like sigs yaml version 1 is used in Argo CD now. Overall, this would be a breaking change, e.g. in my case there's already a config that specifies nanoseconds int for a duration.

I think this may be a change we want for Argo CD v3. For now, I suggest to only migrate places that use gopkg.in/yaml.*, but keep existing places that use sigs yaml v1 (if any were updated).

@mmorel-35
Copy link
Contributor Author

This PR only moves from gopkg.in/yaml.v* to sigs.k8s.io/yaml/goyaml.v* .
So if I follow you, that's fine ?

@mmorel-35 mmorel-35 changed the title chore: use sigs.k8s.io/yaml only to handle yaml chore: use sigs.k8s.io/yaml/goyaml.v* instead of gopkg.in/yaml.v* Dec 30, 2024
@mmorel-35 mmorel-35 force-pushed the gomodguard/yaml branch 2 times, most recently from fa5dc53 to ab12e09 Compare December 30, 2024 17:18
@andrii-korotkov-verkada
Copy link
Contributor

Yeah, I believe so.

@crenshaw-dev
Copy link
Member

This one worries me. It's not clear that it makes sense in every case to use the k8s fork. iiuc, the k8s fork is for high-priority fixes for problems that affect core k8s libraries. It's possible that those bugs also affect Argo CD. But it's also possible that the k8s fork trades off things like performance in order to get those bug fixes.

@mmorel-35 mmorel-35 force-pushed the gomodguard/yaml branch 2 times, most recently from c7cc717 to c7fae83 Compare January 3, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for final review
Development

Successfully merging this pull request may close these issues.

4 participants