carvel-dev / kapp-controller

Continuous delivery and package management for Kubernetes.
https://carvel.dev/kapp-controller
Apache License 2.0
268 stars 103 forks source link

Updating a PackageRepository to New Location Does Not Always Update Images #1603

Open nebhale opened 1 month ago

nebhale commented 1 month ago

What steps did you take:

  1. Publish a Package Repository imgpkg bundle containing a cert-manger Package to location A
  2. Create a PackageRepository on a cluster that points to location A
  3. Create a PackageInstall for the cert-manager package above and validate that the Pod image locations are from quay.io
  4. Relocate the Package Repository imgpkg bundle from location A to location B using impkg copy
  5. Update the existing PackageRepository to point to location B and validate that the Pod image locations are now from location B
  6. Relocate the Package Repository imgpkg bundle from location B to location C using imgpkg copy
  7. Update the existing PackageRepository to point to location C and validate that the Pod image locations are still from location B

What happened: Upon the first update of the PackageRepository location, the Pod image locations were updated to match the new location. Upon the second update of the PackageRepository location, the Pod image locations were not updated to match the new location.

What did you expect: I expect that every update of a PackageRepository location updates the Pod image location to match the new PackageRepository location.

Anything else you would like to add: No

Environment:


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

praveenrewar commented 1 month ago

Thank you for the detailed issue @nebhale

100mik commented 1 month ago

This is primarily because kapp-controller caches images based of their sha reference. And this does not change on relocation. THis leads to the older images being consumed. We need to have some time/location based invalidation logic in vendir so that kapp-controller can benefit from this behaviour.