Skip to content

fix: cache key for local images with xp v2.2#111

Draft
christophrj wants to merge 6 commits intocrossplane-contrib:mainfrom
christophrj:fix/cache-local-sha
Draft

fix: cache key for local images with xp v2.2#111
christophrj wants to merge 6 commits intocrossplane-contrib:mainfrom
christophrj:fix/cache-local-sha

Conversation

@christophrj
Copy link
Collaborator

@christophrj christophrj commented Feb 25, 2026

On-behalf-of: @SAP christopher.junk@sap.com

fixes the cache key for local dev images by skipping the parsePackageSourceFromReference part and instead providing the package name directly to friendlyID and adding the local digest in the provider definition to replicate https://github.com/crossplane/build/blob/main/makelib/local.xpkg.mk#L66.

Added a couple of tests for documentation and easier debugging in the future. I suggest to add a complete local image build example in case we run into more problems with this.

On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
@christophrj
Copy link
Collaborator Author

I added a couple of tests to document the cache key behavior.
@schlingemann can you please confirm that this works for you?

@christophrj christophrj marked this pull request as ready for review February 26, 2026 18:16
Copy link
Contributor

@schlingemann schlingemann left a comment

Choose a reason for hiding this comment

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

Does not work for me currently, I'll do some debugging

On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
@christophrj
Copy link
Collaborator Author

Does not work for me currently, I'll do some debugging

my bad, got lost in my local changes 😄 please try again with the latest commit.

@christophrj christophrj marked this pull request as draft March 2, 2026 19:19
@christophrj
Copy link
Collaborator Author

Put back to draft because after another round of testing with @schlingemann we ran into problems with different docker desktop image store settings.

I think we need to address this differently and instead of xp-testing trying to figure out whether or not an image has been built locally, a user could simply provide this as a flag into the setup. This should be more robust and support all kinds of local build setups.

I just tested this with a 'default' podman desktop installation on macos and the resulting image also didn't have any repo digests, similar to the docker classic image store that has been replaced by the containerd image store default quite some time ago https://docs.docker.com/desktop/release-notes/#4340

On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
On-behalf-of: @SAP christopher.junk@sap.com
Signed-off-by: Christopher Junk <christopher.junk@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants