-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Understand the Task
Description
The releasechannel should mirror images based on the releases file to improve configurability.
Related issues:
- Mirroring in file: Task: Extend file format to allow setting the provider to be mirrored (add mirrored property) #111
- Family providers: Task: Extend file format for the releases to support family providers #110
Preferably this should be done using the new ocm localization feature as this allows better transformation of images and relocalization into a new location.
As family providers have a dependency to their parent provider (e.g. aws with the provider-family-aws)
To support family providers and change their location, this dependency needs to be changed to the new location when relocalized.
Using the crossplane rewrite path feature, there is no need to rewrite the images.
https://docs.crossplane.io/latest/concepts/image-configs/#rewriting-image-paths
In the Spike #31 another solution is presented, which shows how to rewrite the dependency inside the image
One problem for family providers is, that the mirrored image still reference the main family provider image inside its package.yaml.
Found a solution by building a new docker image referencing the provider image and changing the dependency to a mirrored family provider image.FROM xpkg.upbound.io/upbound/provider-aws-ec2:v1 AS origin # Stage 1: Use a base image with a shell to modify the file FROM alpine:latest AS builder WORKDIR / COPY --from=origin package.yaml . RUN sed -i 's|xpkg.upbound.io/upbound/provider-family-aws|<NEW_REGISTRY>/provider-family-aws|g' package.yaml # Stage 2: Use the final image without a shell FROM xpkg.upbound.io/upbound/provider-aws-ec2:v1 WORKDIR / COPY --from=builder /package.yaml /package.yaml ENTRYPOINT ["provider"]Changing files inside a docker file would be a nice plugin for the new OCM localization feature.
Originally posted by @n3rdc4ptn in #31
Any further valuable resources.
- https://docs.crossplane.io/latest/concepts/image-configs/#rewriting-image-paths
- Spike: Check effort for family provider implementation in Releasechannel #31
What is required to accept the Task as done.
Done Criteria
- ...
- Code has been reviewed by other team members
- Internal technical Documentation created/updated
- New / changed code is documented
- Unit Tests created for new code or existing Unit Tests updated
- Integration Test Suite updated
- Enduser Documentation updated (if applicable)
- Successful demonstration in Review