nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93 stars 52 forks source link

Porch: creation time for package revisions continuously updates #630

Open liamfallon opened 2 months ago

liamfallon commented 2 months ago

Original issue URL: https://github.com/kptdev/kpt/issues/3992 Original issue user: https://github.com/johnbelamaric Original issue created at: 2023-06-29T22:00:27Z Original issue last updated at: 2023-06-30T18:00:02Z Original issue body: ### Expected behavior Creation time never changes.

Actual behavior

It changes every time the package is updated.

Information

https://github.com/GoogleContainerTools/kpt/blob/main/porch/pkg/git/package.go#L160

Original issue comments: Comment user: https://github.com/johnbelamaric Comment created at: 2023-06-29T22:01:44Z Comment last updated at: 2023-06-29T22:01:44Z Comment body: Was this done intentionally? What would happen if we fix it?

I have an auto-approve controller, but it won't touch the package revision until it has "aged" appropriately (that in and of itself is a workaround for concurrency issues). This can make it take a long time, even if there are no "real" updates happening still.

Comment user: https://github.com/johnbelamaric Comment created at: 2023-06-29T22:03:56Z Comment last updated at: 2023-06-29T22:03:56Z Comment body: OCI looks like it doesn't have this behavior: https://github.com/GoogleContainerTools/kpt/blob/main/porch/pkg/oci/oci.go#L420

Comment user: https://github.com/mortent Comment created at: 2023-06-30T17:27:53Z Comment last updated at: 2023-06-30T17:27:53Z Comment body: This is not intentional behavior, so I don't think there should be any problems with fixing it. We would just need to decide what would be the source for determining the creation date. We could probably do this by walking the commits pertaining to a package, but that could be somewhat expensive. Another option that sounds simpler is to just wire through the CreationTimestamp from the underlying CR we use to store metadata about PackageRevisions.

Comment user: https://github.com/johnbelamaric Comment created at: 2023-06-30T18:00:02Z Comment last updated at: 2023-06-30T18:00:02Z Comment body: Cool, thanks. With #3993 I think the chaos of continuous updates is abating, so it may not be as much of an issue. But still should be fixed.