Skip to content

Task: Optimize mirroring and ocm creation #112

@n3rdc4ptn

Description

@n3rdc4ptn

Understand the Task

Description

The releasechannel should mirror images based on the releases file to improve configurability.

Related issues:

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/taskGeneral task that needs to be done.needs/validationVerify Issue and Prio with PO

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions