-
Notifications
You must be signed in to change notification settings - Fork 231
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
Support metadata fields on packagerevision resources #3550
Comments
WhereWe probably want to store the values of these fields with the rest of the information about the resources, i.e. we need to include this metadata about resources in git and oci. Relationship with package lifecycleThese fields should also be mutable independently of the lifecycle of packages and revisions. So while the Spec for a published packagerevision can't be updated, it should still be possible to update labels, annotations, owner refs and finalizers. gitGit is currently the most important and mostly used storage backend for packages and revisions. There are two high-level approaches to how we can store metadata in git:
The drawback of including this information in regular commits, is that we will no longer have the 1:1 relationship between commit and changes to the content of a package. It will require that we add new commits every time the metadata changes. In both situations, it will not be obvious to users how to add this information to packages when interacting directly with git. But on the other hand, that would be mostly related to content, so manipulating the metadata about a package revision resource will probably mostly happen through porch or the kpt cli. We should make sure we have good porcelain for doing this. Using git notes (or something similar)Git notes is essentially just information associated with a commit that is stored on a special branch in git (stored at So an alternative to using git notes could be to put metadata about package revisions in a special porch branch (something like ociIt seems like this is an easier problem for oci, since every change to a package revision will lead to a new oci image being constructed. Thus, we should be able to always include the metadata in the metadata about the top layer in the image. |
"metadata.Generation" is important for controllers to know that the version of the resource they are operating on is the most recent. It's also necessary for managing the relationship between status and spec - the observed generation vs the current intended state generation. AFAIK, in ordinary K8s controllers, generation is bumped when metadata changes, but it is up to the specific resource. We need to think about whether metadata should contribute here to the generation or not. @apelisse may have some good insight here. See also:
|
Oh - that said, I lean towards a special porch branch for metadata about a package. But we'll need a thorough evaluation. |
Yeah, I hadn't thought about Similar, when I started thinking about Conditions for packagerevisions, we also need a place to store status information for the packagerevision. I think we probably want do handle that in the same way as we do for metadata. |
Package conditions might end up different from actual resource status conditions. I was imagining them as actually set in either the Kptfile or as a their own separate resource. They may also be surfaced as status conditions, but I think we're going to need them stored in-package. Not 100% on that though. |
FYI, looks like the best practice is to drive generation based on spec only: kubernetes/kubernetes#67428 (comment) |
Why not store the metadata related to packagerevision in CRs ? |
With #3655, we have support for the basic metadata fields. Closing this issue. |
The PackageRevision resource currently doesn't support several of the metadata fields commonly used to build controllers. This includes labels, annotations, owner references and finalizers. We need to add support for these fields on the packagerevision, packagerevisionresources and package resources.
The text was updated successfully, but these errors were encountered: