fluxcd / flux2

Open and extensible continuous delivery solution for Kubernetes. Powered by GitOps Toolkit.
https://fluxcd.io
Apache License 2.0
6.41k stars 594 forks source link

Allow diffing of two OCI artifacts #3839

Open hiddeco opened 1 year ago

hiddeco commented 1 year ago

To help people to gather an idea about the difference between two artifacts, we could introduce a flux diff artifact <URL1> <URL2> command which provides a (Git like) diff of the differences within the compressed tar+gzip layers of the Artifact images.

To build this functionality, we need to decide on the diff library that should be used. Theoretically, we could piggy back on the diff utility library from go-git in combination with DiffPrettyText. However, there are discussions at present to replace this due to certain issues.

An additional thing to take into account is that full decompression of <URL1> and/or <URL2> to disk may not be required, but that we rather iterate over the contents using tar#NewReader in combination with reading the file contents from the current tar#Header using io.Copy(out, reader).

sbdtu5498 commented 1 year ago

/assign

makkes commented 1 year ago

@sbdtu5498 we don't have automation for assignments in place here. The issue is assigned to @somtochiama so if you'd like to work on it it'd be best to discuss next steps with her. I'd also encourage you to join the next regular meeting.

sbdtu5498 commented 1 year ago

Sure, @somtochiama if you aren't working on it, I can pick it up. Thanks for the invitation @makkes! I will make sure to do that.

somtochiama commented 1 year ago

@sbdtu5498 You can have a go at it.

Something to note is that there is an existing diff artifact command that checks if there's a diff between a remote OCI URL and a local directory (it doesn't show a diff, just says if there have been any changes).

So diff artifact command should be updated to show the actual diff between either another URL or a local directory.

sbdtu5498 commented 1 year ago

@somtochiama thanks a lot for the information. I will keep that in mind.

somtochiama commented 1 year ago

Hey @sbdtu5498 , are you still working on this?

sbdtu5498 commented 1 year ago

@somtochiama sorry for the delays. I was a bit busy. I need to do testing and add the test cases as well so it is still a WIP. I have left some comments in PR let me know on that as well.

calerogers commented 6 months ago

Hello I just wanted to see if there is any more movement on this? I’d be interested to see this functionality added.

cc @sbdtu5498